sherlockturtle
09-14-2011, 10:27 PM
how would you make a function that cheks if any text is in a text box.
|
||||
text in textboxsherlockturtle 09-14-2011, 10:27 PM how would you make a function that cheks if any text is in a text box. Old Pedant 09-14-2011, 11:56 PM if ( document.formName.fieldName.value = "" ) { alert("field is empty"); } else { alert("field is not empty"); } If you want to make sure the field has something *other* than just spaces, just strip out the spaces: if ( document.formName.fieldName.value.replace(/\s/g,"") = "" ) sherlockturtle 09-15-2011, 12:36 AM Thanks, i wonder why i didint think of that... |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum