N
nntp-service.ohio-state.edu
Hey folks -
I'm a newbie to java script. I'm trying to make a portable data-validator
for fields in an HTML form.
Ideally, it would work something like this:
<input type="text" name="test" onBlur=check_data(this.value, "date")>
The script would check the data against its data type (date, number, text)
and then spit out an error if the data wasn't the correct type.
I've seen scripts that check the data when the user hits the 'submit'
button. I would instead prefer to use the onblur event of each field.
To make it portable, it would then return focus to the field that the user
just entered data into.
Where I'm running into problems is referring to the field name. I've tried
referencing "this.parentnode.name", "this.parentnode.nodename",
"this.parentelement.name", etc. to no avail. I would like it to work with NN
6.x and IE5.x, but nowhere have I found a comprehensive guide to what
browser works with what javascript commands.
Can someone point me in the right direction?
I'm a newbie to java script. I'm trying to make a portable data-validator
for fields in an HTML form.
Ideally, it would work something like this:
<input type="text" name="test" onBlur=check_data(this.value, "date")>
The script would check the data against its data type (date, number, text)
and then spit out an error if the data wasn't the correct type.
I've seen scripts that check the data when the user hits the 'submit'
button. I would instead prefer to use the onblur event of each field.
To make it portable, it would then return focus to the field that the user
just entered data into.
Where I'm running into problems is referring to the field name. I've tried
referencing "this.parentnode.name", "this.parentnode.nodename",
"this.parentelement.name", etc. to no avail. I would like it to work with NN
6.x and IE5.x, but nowhere have I found a comprehensive guide to what
browser works with what javascript commands.
Can someone point me in the right direction?