$('form > input').trigger('click') //with a reset button in the form set to display: none jQuery Element Function $.fn. You can put a hidden input of type reset and then trigger it to clear the form. (this works for both single and multiple select elements) select elements need to have their 'selectedIndex' property set to -1 but should *not* have their 'value' changedĮlse if (type = 'checkbox' || type = 'radio') To open the Command History window and display a specific statement, type any part of the statement at the prompt and then press the Up Arrow key. checkboxes and radios need to have their checked state cleared To open the Command History window with all history showing, in the Command Window, press the Up Arrow key () or enter commandhistory. If (type = 'text' || type = 'password' || tag = 'textarea') it's ok to reset the value attr of text inputs, iterate over all of the inputs for the form It simply removes all data from the form including text inputs, select boxes, radio buttons, checkboxes etc… There are two versions and the second version is probably more useful as you can apply it directly to the DOM element as a jQuery function. Pretty useful jQuery Function to clear all form data which I found on Karl Swedberg’s website.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |