View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Validating Multipage form

Thread began 1/11/2010 11:55 am by Walikan | Last modified 1/25/2010 6:26 pm by Walikan | 2764 views | 11 replies

Walikan

Validating Multipage form

Hello Jimmy,
Thanks a million. It worked perfectly. You made my day.
Just a very last question. I forgot to add a page (page.php) in the attachment on the previous post.
On the page.php, I have hand coded a php switch condition statement and I have a form below to integrate the switch statement. In the form there are 3 radio buttons representing Pages i e
radio button1 = page1.php
radio button2= page2.php
radio button3 =page3.php

When a user select say, radio button1 and complete the rest of the form fields and then clicks on the submit button, the user is redirected to page1.php
Similarly selecting radio button2 and complete the other form elements in the form and then clicks on submit button, the user is redirect to page2.php. I know I need to add a custom code on the form action, any help on how to achive this? See attachment for details


<?php
session start()
switch(#{destination}) {

case "1" :
header("Location: page1.php");
break;
case "2 ":
header("Location: page2.php");
break;
case "3 ":
header("Location: page3.php");
break;

}
exit();
?>
<form id="form1" method="post" action=" ">
<table width="403" border="0">
<tr>
<td width="104"><p>
<label>
<input type="radio" name="select" value="p1" id="select_0" />
Page 1</label>
<br />
<label>
<input type="radio" name="select" value="p2" id="select_1" />
Page 2</label>
<br />
<label>
<input type="radio" name="select" value="p3" id="select_2" />
Page3</label>
<br />
</p></td>
<td width="144">&nbsp;</td>
<td width="141"><?php
if (ValidatedField('page1_214','page1_214')) {
if ((strpos((",".ValidatedField("page1_214","page1_214").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<font color="#FF0000">Select one</font>
<?php //WAFV_Conditional page1.php page1_214(1:)
}
}
}?></td>
</tr>
<tr>
<td>Arrival Date</td>
<td><label>
<input name="ArrivalDate" type="text" id="ArrivalDate" size="10" />
</label></td>
<td><?php
if (ValidatedField('page1_214','page1_214')) {
if ((strpos((",".ValidatedField("page1_214","page1_214").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<font color="#FF0000">Pick Date</font>
<?php //WAFV_Conditional page1.php page1_214(2:)
}
}
}?></td>
</tr>
<tr>
<td>Arrival Time</td>
<td><label>
<input type="text" name="ArrivalTime" id="ArrivalTime" />
</label></td>
<td><?php
if (ValidatedField('page1_214','page1_214')) {
if ((strpos((",".ValidatedField("page1_214","page1_214").","), "," . "3" . ",") !== false || "3" == "")) {
if (!(false)) {
?>
<font color="#FF0000">Time is required</font>
<?php //WAFV_Conditional page1.php page1_214(3:)
}
}
}?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><label>
<input type="submit" name="submit" id="submit" value=">>> Continue" />
</label></td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</form>

Thanks alot for the help

Attached Files
MultipageFprm.zip

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...