Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Web >> Development >> Javascript >> How to blank out input form elements

function NewForm(FormName) { for (var i = 0; i < document.forms[FormName].elements.length; i ) { if ( document.forms[FormName].elements[i].type == 'text' ) { document.forms[FormName].elements[i].value = ''; } if ( document.forms[FormName].elements[i].type == 'textarea' ) { document.forms[FormName].elements[i].value = ''; } if ( document.forms[FormName].elements[i].type == 'select-one' ) { document.forms[FormName].elements[i].options[0].selected = true; // this assumes that the first option element contains blank } } return true; }
[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]