[jQuery] Re: selectbox: change selected item

2007-07-17 Thread Klaus Hartl
zenx wrote: Hi, I don't know how to change the selected item in a selectbox. I tried this but it doesn't work as expected. HTML code: = select id=id_cliente name=cliente size=1 option value= selected=selected-/option option value=1First/option option

[jQuery] Re: selectbox: change selected item

2007-07-17 Thread Dan G. Switzer, II
I don't know how to change the selected item in a selectbox. I tried this but it doesn't work as expected. HTML code: = select id=id_cliente name=cliente size=1 option value= selected=selected-/option option value=1First/option option value=2Second/option /select

[jQuery] Re: selectbox: change selected item

2007-07-17 Thread Klaus Hartl
Dan G. Switzer, II wrote: I don't know how to change the selected item in a selectbox. I tried this but it doesn't work as expected. HTML code: = select id=id_cliente name=cliente size=1 option value= selected=selected-/option option value=1First/option option

[jQuery] Re: selectbox: change selected item

2007-07-17 Thread Dan G. Switzer, II
Using my Field plug-in (http://jquery.com/plugins/project/field) you could do: $(#id_cliente).setValue(2); The big benefit to using my Field plug-in is that you can change the form field from a select box to a checkbox or radio element and you would not have to refactor code that

[jQuery] Re: selectbox: change selected item

2007-07-17 Thread Mike Alsup
Klaus, As Dan pointed out, his Field plugin is very adept at getting, setting and otherwise manipulating data for field elements and Dan is adding new capabilities regularly. The Form plugin is mostly geared at providing ajax capabilities for the submit process. It also provides methods for

[jQuery] Re: selectbox: change selected item

2007-07-17 Thread Klaus Hartl
Mike Alsup wrote: Klaus, As Dan pointed out, his Field plugin is very adept at getting, setting and otherwise manipulating data for field elements and Dan is adding new capabilities regularly. The Form plugin is mostly geared at providing ajax capabilities for the submit process. It also

[jQuery] Re: selectbox: change selected item

2007-07-17 Thread zenx
Klaus, Dan, thank you for your help. I tried both ways and they worked correctly. I think I will use the Field plugin for many things in the future. Thank you! On 17 jul, 18:37, Klaus Hartl [EMAIL PROTECTED] wrote: Mike Alsup wrote: Klaus, As Dan pointed out, his Field plugin is very