Tech Support Guy banner
Status
Not open for further replies.
1 - 3 of 3 Posts

·
Registered
Joined
·
221 Posts
Discussion Starter · #1 ·
During form validation in VBS, how do I return focus to txtGross after displaying the message?

SCRIPT LANGUAGE="VBScript"

function verify_form()

if isNumeric(document.frmTax.txtGross.value) then
verify_form = true
else
msgBox "Please enter a numeric number gross income figure:"
document.frmTax.txtGross.set.focus
verify_form = false
end if

if (document.frmTax.txtGross.value.len) < 1 then
msgBox "Please enter a numeric gross income:"
document.frmTax.txtGross.set.focus
verify_form = false
else
verify_form = true
end if
End Function
/script

With the above code, I end up on my .asp page with an error message stating "type mismatch" (it sends an empty string and the .asp is expecting a numerical input).

How do I display the message and then return the focus to txtGross?

Thanks,
John
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top