Form Validation

G

Guest

Is it possible to create a form in FrontPage that must have validated
information in it, but for that form to not display what it is that needs to
be validated if the given result is not equal to the validation?

For example, I set the validation on a text box to require a value equal to
6. If one enteres a 6 and submits that form, there is no problem. If,
however, one enters anything other than a 6, FP displayers an error that says
"[Name of Textbox 1] needs to be equal to the value 6." I don't want that
message to tell what Textbox 1 needs to be equal to. If the value isn't
equal, I want it to say "That is not the correct answer" or erradicate that
dialog box together.

Is this possible? If so, how would I go about doing it? If not, how would I
hand-code something like that?

Thanks
 
T

Thomas A. Rowe

No. You would have to write a custom server-side form process to check the value, if OK continue, if
not return.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
J

Jon Spivey

Hi,
FP can't do this but it's easy enough to handcode. Eg
<script type="text/javascript">
function checkIt(f){
if(f.TextBox.value!='6'){
alert('Wrong Answer');
f.TextBox.focus();
return false;}return true;}
</script>
<form onsubmit="return checkIt(this);">
Enter your answer <input type="text" name="TextBox">
......
</form>

This assumes that the correct answer would be the number 6, you can change 6
to whatever you need. This is the important line
if(f.TextBox.value!='6'){ In javascript != means not equal to, return false
means don't submit the form return true means submit it. Hopefully this
will get you started, post back if you need to
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top