|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Default value for TextInput ?
Hi List,
I would like to have something like that : http://www.electrictoolbox.com/jquery-change-default-value-on-focus/ A default value for my form textboxes. I would like to have this behavior but without broke the form validation etc... Does someone has already wrote a plugin like that ?! Thanks for any help, Regards _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: Default value for TextInput ?I think, we should add a new attribute called "defaultValue" in order to do this. What do you think about ?! Thanks, Le 30/06/2009 12:36, Apsy a écrit : Hi List, _______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://dojotoolkit.org/docs/book Forums: http://dojotoolkit.org/forum Dojo-interest@... http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest |
|
|
Re: Default value for TextInput ?Hi Apsy,
You could try something like the following: // execute the following method when the page finishes loading dojo.addOnLoad({ // connect the following method to the onChange event on the myFormField DOM Node dojo.connect(dojo.byId('myFormField'), 'onfocus', { // find the dijit object associated with myFormField (the INPUT domNode must have a dojoType attribute) var myFormFieldWidget = dijit.byId('myFormField'); // if the dijit object is found and its value is blank, set its value to the default if(myFormFieldWidget && !myFormFieldWidget.getValue()) dijit.byId('myFormField').setValue('my default value'); }); })
|
| Free embeddable forum powered by Nabble | Forum Help |