2012-01-21 7 views
0

私は、より多くの選択、チェックボックス、入力(jQuery UI)を持つ検索フォームを持っています。jQuery UI、cookie

選択した要素をクッキーで保存するにはどうすればよいですか?提出の圧力の後、1つの値を変更することはできますが、すべてを新たに選択することはできません。あなたはこのためにクッキーを使用する場合は

答えて

0

あなたは、私が知っているjQueryのクッキープラグインにhttps://github.com/carhartl/jquery-cookie

Create session cookie: 
$.cookie('the_cookie', 'the_value'); 

Create expiring cookie, 7 days from then: 
$.cookie('the_cookie', 'the_value', { expires: 7 }); 

Create expiring cookie, valid across entire page: 
$.cookie('the_cookie', 'the_value', { expires: 7, path: '/' }); 

Read cookie: 
$.cookie('the_cookie'); // => 'the_value' 
$.cookie('not_existing'); // => null 

Delete cookie by passing null as value: 
$.cookie('the_cookie', null); 
+0

を使用することができ、私はあなたがあなたの質問をclairfyする必要が –

+0

jQueryのUIに接続する方法がわかりません。 – KMan

+0

どのようにフォームのすべてを歩くと、選択した要素を暗記する?それはページの更新時に、選択された要素が選択されたままであった –