Javascript – Test if form element exists

var myobj = document.form.fieldname;
if (myobj != null || myobj != 'undefined'){
//do something
}

Cup size   
Select size then click on coffee cup.
This entry was posted in Code, Javascript, Snippets. Bookmark the permalink.