VBScript

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jwaldrich

Thread Starter
Joined
Jun 28, 2000
Messages
221
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
 
Joined
Jul 29, 2001
Messages
21,334
Try using = "" for a null value instead of <1. Don't know if that fits the value or not.
 

jwaldrich

Thread Starter
Joined
Jun 28, 2000
Messages
221
What I finally ended up doing was using "if" statements and href on the ASP page but it works.

Thanks for your quick response!

Regards,

John
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top