Click to See Complete Forum and Search --> : If textbox is blank give it a zero value


jeremy_callahan
07-28-2003, 12:13 PM
Hello,

I'm need some javascript code that will check for a blank value in a text field and if it is blank, insert a zero as it's value.

Thanks,

pyro
07-28-2003, 12:24 PM
Something like this:

<script type="text/javascript">
if (document.formname.inputname.value == "") {
document.formname.inputname.value = "0";
}
</script>

jeremy_callahan
07-28-2003, 03:08 PM
Thanks, that worked great!

pyro
07-28-2003, 03:12 PM
You're welcome... :)