Folk,<br>
<br>
I really need some help on this, 'cause I'm novitiate in this area.<br>
<br>
I need to be able to do some forms input validation <b>before</b> allowing web-page input to be stored in a database (SQL Server 7.0, but that shouldn't be significant, I'd think).<br>
<br>
I can do the validation by referencing every input field in the form, but I have to do that for each individual form.<br>
<br>
What I would <i>like</i> to do would be to set up a routine similar to what I can do with the Visual Basic 'TypeOf' conditional.<br>
<br>
For instance, in VB I can do<br>
<br>
{code simulacrum]<br>
Sub Validate (somecontrol as Control)<br>
If TypeOf somecontrol is textbox then<br>
. . .<br>
Else If TypeOf somecontrol is maskeditbox then<br>
. . .<br>
End If<br>
End Sub<br>
<br>
[/code simulacrum]<br>
<br>
and validate control content based upon the control type, e.g., determine text in a text area or input box, determine value of an option button array, etc..<br>
<br>
Is there a way to do this with JavaScript?<br>
<br>
When I'm looking at fifty or sixty forms, this would show great economies of sanity!<br>
<br>
Make a good day . . .<br>
. . . barn<br>
<br>
<br>
I really need some help on this, 'cause I'm novitiate in this area.<br>
<br>
I need to be able to do some forms input validation <b>before</b> allowing web-page input to be stored in a database (SQL Server 7.0, but that shouldn't be significant, I'd think).<br>
<br>
I can do the validation by referencing every input field in the form, but I have to do that for each individual form.<br>
<br>
What I would <i>like</i> to do would be to set up a routine similar to what I can do with the Visual Basic 'TypeOf' conditional.<br>
<br>
For instance, in VB I can do<br>
<br>
{code simulacrum]<br>
Sub Validate (somecontrol as Control)<br>
If TypeOf somecontrol is textbox then<br>
. . .<br>
Else If TypeOf somecontrol is maskeditbox then<br>
. . .<br>
End If<br>
End Sub<br>
<br>
[/code simulacrum]<br>
<br>
and validate control content based upon the control type, e.g., determine text in a text area or input box, determine value of an option button array, etc..<br>
<br>
Is there a way to do this with JavaScript?<br>
<br>
When I'm looking at fifty or sixty forms, this would show great economies of sanity!<br>
<br>
Make a good day . . .<br>
. . . barn<br>
<br>