-----Original Message-----
I want to add a simple Form Field & Push Button so that
when selected, will validate a field to allow the user to
go to the next page or not. Nothing fancy.
I created a separate htm page with a form field:
How do you verify the field (when the button is selected)?
First, make sure the button is truly a pushbutton
(type="button") and not a Submit button (type="submit").
Then, add an onclick= atribute as shown below:
<input type="button" onclick="valForm();" value="Next"
name="btnNext">
Finally, add a script such as the following anywhere in
the Web page. (The <head> section is a common choice.)
<script>
function valForm(){
}
How do you, programmatically with JavaScript's, open the
next page ordisplay a blank page.
Inside the fucntion you just created, code whatever tests
you want want, then set window.location.href to the URL of
the next page to display. Here's an example that assumes a
text box named txtName shouldn't be empty.
<script>
function valForm(){
if (document.forms[0].txtName.value == "") {
return 0;
} document.location.href="nextpage.htm";
}
</script>
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------