Jump to content

Recommended Posts

my issue is two-fold:

 

1- even though the form is live it only sends from my mac

2- the only time i get the thank you response (see add-account.php) "Your information is currently being processed. Please allow up to 48 hours for a response." is from my mac.

 

I have tested on two different pc's and after completing the form it just loops right back to the beginning and doesn't send.

 

 

I have attached all the files associated with the form. Any help would be tremendously appreciated. Thank you.

 

add-account.html

add-account.php

header.php

loader.php

index.php

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/161819-php-form-headaches/
Share on other sites

yes. very weird. it's giving me a headache. lol :-/

 

see the .php file below:

 

 

<?php

$title = "Stony Brook University - Campus Dining - Manage Your Meal Plan";
$response = "";


if (isset($_GET['submit1'])) {

switch($_GET['meal']) {

	case "other":
		break;
	case "fac":
		break;
	case "bug":

		$body['semester'] = $_GET['frame'];
		$body['step'] = 2;
		break;
}

} elseif (isset($_POST['submit'])) {

$message = "";
foreach($_POST as $key=>$value) {
	if($key != "submit") {
		$message .= $key.": ".$value."\n\n";
	}
}

$posted = $_POST;

$sunyid = $posted['suny1']." ".$posted['suny2']." ".$posted['suny3']." ".$posted['suny4'];
$card = $posted['id1']." ".$posted['id2']." ".$posted['id3'];
$phone = "(".$posted['telephone1'].") ".$posted['telephone2']."-".$posted['telephone3'];

$message = "Name: {$posted['fname']} {$posted['lname']}\n\nEmail Address: {$posted['email']}\n\nDaytime Phone: $phone\n\nCard Number: $sunyid\n\nID Number: $card\n\nAmount to Add: {$posted['addamount']}\n\nSemester: {$posted['semester']}";
$subject = "Add Money to Your Meal Plan Submittal";

	mail('dsalzman@notes.cc.sunysb.edu', $subject, $message, 'From: Campus Dining - Add Money to Your Meal Plan Form <'.$posted['email']. '>');
	$body['response'] = '<p align="center">Your information is currently being processed.  Please allow up to 48 hours for a response.</p>';


}

$oTpl->assign($body);
$output = $oTpl->fetch($page.'.html');
?>

Link to comment
https://forums.phpfreaks.com/topic/161819-php-form-headaches/#findComment-853787
Share on other sites

hmm ok thanks! here is the html code:

 

{if $response}
{$response}
{elseif !$step}
<!-- table 0-->
<table border="0" cellpadding="2" cellspacing="0" width="92%">

<tbody><tr>
<td valign="center"><img src="images/block_amtc.gif"></td>
<td align="right"><img src="images/lock.gif"><b>THIS AREA IS SECURE.</b></td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10"></td>
</tr>

<tr>
<td class="page_title" colspan="2">Add Money to Your Card Application.</td>

</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10"></td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10"></td>
</tr>

<tr>
<td class="med" colspan="2">Thank you for your interest. 
You can add money to your card with this secure online application. Please just follow the easy steps.
</td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10"></td>

</tr>

<tr>
<td colspan="2" align="center">


<form action="index.php" method="get" name="mealselect" onsubmit="return validateFormNew(this)">
    <input type="hidden" name="page" value="add-account" />
    <input type="hidden" name="submit1" value="submitted" />
<!-- table 1 -->
<table border="0" cellpadding="2" cellspacing="2" width="91%">

<tbody><tr>
<td rowspan="2"><img src="images/step1.gif"></td>

<td class="med" valign="top"><b>1.</b> What semester would you like this transaction to take place in:  </td>
<td valign="top">


<select name="frame">

	<option value="x" selected="selected">Pick a semester</option>
<option value="Summer 2009">Summer 2009</option>


	</select>

</td>
</tr>


<tr>
<td class="med"><b>2.</b> Please select the type of Meal Plan you have.</td>
<td>
<select name="meal">

<option value="nil" selected="selected">Choose one</option>
	<option value="bug">Summer Budget Plan</option>

	</select>		


</td>
</tr>

</tbody></table>
<!-- table 1 end -->



</td>
</tr>
</tbody></table>
<!-- table 0 end -->

 <p>
<input src="images/but_continue.gif?PHPSESSID=55a2c8b086cc6db8855b73fc3e2d922d" value="Submit" alt="submit" border="0" type="image">
<br><br>
</form>

</p></center>

{elseif $step == 2}

<!-- table 0 -->
<table border="0" cellpadding="2" cellspacing="0" width="92%">
<tbody><tr>
<td valign="center"><img src="images/block_amtc.gif"></td>
<td class="med" align="right"><img src="images/lock.gif"><b>THIS AREA IS SECURE.</b></td>
</tr>
</tbody></table>
<!-- table 0 end -->

<p>

<!-- table 1 -->
<table border="0" cellpadding="0" cellspacing="0" width="92%">
<tbody><tr>

<td colspan="2">
<form method="post" action="index.php?page=add-account" name="form2" onsubmit="return validateAddForm(this);" autocomplete="off">
<input type="hidden" name="semester" value="{$semester}" />

<!-- table 2 -->
<table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td valign="top"><img src="images/step2.gif"></td>
<td><img src="images/empty.gif" width="9" height="1"></td>
<td width="100%"><b>Add Money to Your Meal Plan - Bill to Student Account</b><p>

In order for us to process your request, all field must be completed.
</p><p>
<font color="#990000"><b>If you have a new Stony Brook ID Card, please enter the 16 digit number from that card as well.</b></font>
</p></td>
</tr>
</tbody></table>
<!-- table 2 end-->



</td>
</tr>

<tr>
<td valign="top"><p><br><b>Your VALID email address</b></p></td>
<td valign="top"><p><br><b>Amount You'd Like to Add</b></p></td>
</tr>

<tr>
<td valign="top"><input name="email" class="text" size="19" value=""></td>
<td valign="top"><b>$</b><input name="addamount" class="text" size="5" value=""></td>
</tr>

<tr>
<td><p><br><b>First Name</b></p></td>
<td><p><br><b>Last Name</b></p></td>
</tr>

<tr>
<td><input name="fname" class="text" size="19" value=""></td>
<td><input name="lname" class="text" size="19" value=""></td>
</tr>

<tr>
<td><p><br><font color="#990000"><b>ID Number</b></font><br> (9 Digits)</p></td>

<td><p><br><b>Daytime Telephone</b><br> (10 digits)</p></td>
</tr>

<tr>
<td><input class="text" name="id1" size="3" maxlength="3" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.id2)" value="">-<input class="text" name="id2" size="3" maxlength="3" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.id3)" value="">-<input class="text" name="id3" size="3" maxlength="3" value=""></td>
<td>(<input class="text" name="telephone1" size="3" maxlength="3" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.telephone2)" value="">)-<input class="text" name="telephone2" size="3" maxlength="3" value="" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.telephone3)">-<input class="text" value="" name="telephone3" size="4" maxlength="4"></td>
</tr>

<tr>	

<td><p><br><font color="#990000"><b>Card Number</b></font><br> (16 Digits)</p></td>
<td>  </td>
</tr>

<tr>
<td><input class="text" value="" name="suny1" size="4" maxlength="4" nkeydown="TabNext(this,'down',4)" onkeyup="TabNext(this,'up',4,this.form.suny2)">-<input class="text" value="" name="suny2" size="4" maxlength="4" nkeydown="TabNext(this,'down',4)" onkeyup="TabNext(this,'up',4,this.form.suny3)">-<input class="text" name="suny3" size="4" maxlength="4" value="" nkeydown="TabNext(this,'down',4)" onkeyup="TabNext(this,'up',4,this.form.suny4)">-<input class="text" name="suny4" size="4" maxlength="4" value=""></td>
<td> </td>
</tr>

<tr>	

<td><p>(If you have not yet received your card you may enter all zeroes)</p></td>
<td>  </td>
</tr>

<tr>
<td colspan="2">
 <p>
I understand that by hitting continue I am authorizing for you to automatically bill my student account. This request will only be processed if your student account is in good standing.
</p><p>
PLEASE NOTE: Your meal card will reflect these changes on the same business 
day, if submitted before 3pm. If submitted after 3pm, your request will be processed the next working day.
</p></td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10"></td>

</tr>

<tr>
<td colspan="2">
<input name="readcheck" type="checkbox"> <font color="#990000"><b>I have read and understand the <a href="http://www.campusdining.org/mealplans.php">Meal Plan Information</a>.</b></font>
</td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="18"></td>
</tr>

<tr>

<td colspan="2" align="center"><input src="images/but_continue.gif" value="Submit" alt="submit" name="submit" border="0" type="image"><p></p></form></td>
</tr>
</tbody></table>
<!-- table 1 end -->


</p><p>
</p>

{/if}

Link to comment
https://forums.phpfreaks.com/topic/161819-php-form-headaches/#findComment-853802
Share on other sites

new problems today... it seems that the form is not validating in IE, but seems to validate just fine in firefox.

 

HTML

{if $response}
{$response}
{elseif !$step}
<!-- table 0-->
<table border="0" cellpadding="2" cellspacing="0" width="92%">

<tbody><tr>
<td valign="center"><img src="images/block_onmp.gif" alt=""></td>
<td align="right"><img src="images/lock.gif" alt=""><b>THIS AREA IS SECURE.</b></td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10" alt=""></td>
</tr>

<tr>
<td class="page_title" colspan="2">Welcome to Campus Dining's New Meal Plan Application.</td>

</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10" alt=""></td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10" alt=""></td>
</tr>

<tr>
<td class="med" colspan="2">Thank you for your interest. 
You may choose to open a new meal plan with this secure online application. Please just follow the easy steps. 
</td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10" alt=""></td>

</tr>

<tr>
<td colspan="2" align="center">


<form action="index.php" method="get" name="mealselect" onsubmit="return validateFormNew(this)">
    <input type="hidden" name="page" value="new-account" />
    <input type="hidden" name="submit1" value="submitted" />
<!-- table 1 -->
<table border="0" cellpadding="2" cellspacing="2" width="91%">

<tbody><tr>
<td rowspan="2"><img src="images/step1.gif" alt=""></td>

<td class="med" valign="top"><b>1.</b> What semester would you like this transaction to take place in:  </td>
<td valign="top">


<select name="frame">

	<option value="x" selected="selected">Pick a semester</option>
	<option value="Summer 2009">Summer 2009</option>
	<option value="Fall 2009">Fall 2009</option>
	<!--<option value="Spring 2010">Spring 2010</option> -->

</select>

</td>
</tr>


<tr>
<td class="med"><b>2.</b> Please select the type of Meal Plan you desire.</td>
<td>
<select name="choose_mp">

	<option value="nil" selected="selected">Choose one</option>
	<option value="Summer Budget Plan">Summer Budget Plan</option>

	<option value="Apartment 250">Apartment 250</option>
	<option value="Apartment 500">Apartment 500</option>
	<option value="Commuter 250">Commuter 250</option>
	<option value="Commuter 500">Commuter 500</option>

	<option value="Bronze">Bronze Plan</option>
	<option value="Silver">Silver Plan</option>
	<option value="Gold">Gold Plan</option>
	<option value="Platinum">Platinum Plan</option>

</select>		


</td>
</tr>
<tr>
<td colspan="3">
<p style="font-size: 11px; font-family: Verdana,sans-serif; color: rgb(255, 0, 0);"><i><b>Please Note:</b> You must have a <font color="blue">Blue</font> or <font color="green">Green</font> University ID card to sign up for the Faculty/Staff Debit Plan, otherwise you will automatically be moved to a student meal plan.</i></p>

</td></tr>

</tbody></table>
<!-- table 1 end -->



</td>
</tr>
</tbody></table>
<!-- table 0 end -->

 <p>
<input src="images/but_continue.gif?PHPSESSID=55a2c8b086cc6db8855b73fc3e2d922d" value="Submit" alt="submit" border="0" type="submit">
<br><br>
</form>

</p></center>

{elseif $step == 2}

<!-- table 0 -->
<table border="0" cellpadding="2" cellspacing="0" width="92%">
<tbody><tr>
<td valign="center"><img src="images/block_onmp.gif" alt=""></td>
<td class="med" align="right"><img src="images/lock.gif" alt=""><b>THIS AREA IS SECURE.</b></td>
</tr>
</tbody></table>
<!-- table 0 end -->

<p>

<!-- table 1 -->
<table border="0" cellpadding="0" cellspacing="0" width="92%">
<tbody><tr>

<td colspan="2">
<form method="post" action="index.php?page=new-account" name="form2" onsubmit="return validateForm(this);" autocomplete="off">
<input type="hidden" name="semester" value="{$semester}" />
<input type="hidden" name="meal" value="{$meal}" />

<!-- table 2 -->
<table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td valign="top"><img src="images/step2.gif" alt=""></td>
<td><img src="images/empty.gif" width="9" height="1"></td>
<td width="100%"><b>New Meal Plan.</b><p>

If you are a student you may open a new meal plan account right here on our website!  
Simply follow the directions below.
</p><p>
<font color="#990000"><b>If you have a new Stony Brook ID Card, please enter the 16 digit number from that card as well.</b></font>
</p></td>
</tr>
</tbody></table>
<!-- table 2 end-->



</td>
</tr>

<tr>
<td valign="top"><p><br><b>Your VALID email address</b></p></td>
</tr>

<tr>
<td valign="top"><input name="email" id='email' class="text" size="19" value=""></td>
</tr>

<tr>
<td><p><br><b>First Name</b></p></td>
<td><p><br><b>Last Name</b></p></td>
</tr>

<tr>
<td><input name="fname" class="text" size="19" value=""></td>
<td><input name="lname" class="text" size="19" value=""></td>
</tr>

<tr>
<td><p><br><font color="#990000"><b>ID Number</b></font><br> (9 Digits)</p></td>

<td><p><br><b>Daytime Telephone</b><br> (10 digits)</p></td>
</tr>

<tr>
<td><input class="text" name="id1" size="3" maxlength="3" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.id2)" value="">-<input class="text" name="id2" size="3" maxlength="3" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.id3)" value="">-<input class="text" name="id3" size="3" maxlength="3" value=""></td>
<td>(<input class="text" name="telephone1" size="3" maxlength="3" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.telephone2)" value="">)-<input class="text" name="telephone2" size="3" maxlength="3" value="" nkeydown="TabNext(this,'down',3)" onkeyup="TabNext(this,'up',3,this.form.telephone3)">-<input class="text" value="" name="telephone3" size="4" maxlength="4"></td>
</tr>

<tr>	

<td><p><br><font color="#990000"><b>Card Number</b></font><br> (16 Digits)</p></td>
<td>  </td>
</tr>

<tr>
<td><input class="text" value="" name="suny1" size="4" maxlength="4" nkeydown="TabNext(this,'down',4)" onkeyup="TabNext(this,'up',4,this.form.suny2)">-<input class="text" value="" name="suny2" size="4" maxlength="4" nkeydown="TabNext(this,'down',4)" onkeyup="TabNext(this,'up',4,this.form.suny3)">-<input class="text" name="suny3" size="4" maxlength="4" value="" nkeydown="TabNext(this,'down',4)" onkeyup="TabNext(this,'up',4,this.form.suny4)">-<input class="text" name="suny4" size="4" maxlength="4" value=""></td>
<td> </td>
</tr>

<tr>	

<td><p>(If you have not yet received your card you may enter all zeroes)</p></td>
<td>  </td>
</tr>

<tr>
<td colspan="2">
 <p>
I understand that by hitting continue I am authorizing for you to automatically bill my student account. Budget Plan purchases must be made with a credit card.
</p><p>
PLEASE NOTE: Your meal card will reflect these changes on the same business 
day, if submitted before 3pm. If submitted after 3pm, your request will be processed the next working day.
</p></td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="10" alt=""></td>

</tr>

<tr>
<td colspan="2">
<input name="readcheck" type="checkbox"> <font color="#990000"><b>I have read and understand the <a href="http://www.campusdining.org/mealplans.php">Meal Plan Information</a>.</b></font>
</td>
</tr>

<tr>
<td colspan="2"><img src="images/empty.gif" width="1" height="18" alt=""></td>
</tr>

<tr>

<td colspan="2" align="center"><input src="images/but_continue.gif" value="Submit" alt="submit" name="submit" border="0" type="submit"><p></p></form></td>
</tr>
</tbody></table>
<!-- table 1 end -->


</p><p>
</p>

{/if}

 

PHP

<?php

$title = "Stony Brook University - Campus Dining - Manage Your Meal Plan";
$response = "";


if (isset($_GET['submit1'])) {


		$body['semester'] = $_GET['frame'];
		$body['meal'] = $_GET['choose_mp'];
		$body['step'] = 2;


} elseif (isset($_POST['submit'])) {

$message = "";
foreach($_POST as $key=>$value) {
	if($key != "submit") {
		$message .= $key.": ".$value."\n\n";
	}
}


$posted = $_POST;

$sunyid = $posted['suny1']." ".$posted['suny2']." ".$posted['suny3']." ".$posted['suny4'];
$card = $posted['id1']." ".$posted['id2']." ".$posted['id3'];
$phone = "(".$posted['telephone1'].") ".$posted['telephone2']."-".$posted['telephone3'];

$message = "Name: {$posted['fname']} {$posted['lname']}\n\nEmail Address: {$posted['email']}\n\nDaytime Phone: $phone\n\nCard Number: $sunyid\n\nID Number: $card\n\nMeal Plan Choice: {$posted['meal']}\n\nSemester: {$posted['semester']}";
$subject = "New Meal Plan Submittal";

	mail('dsalzman@notes.cc.sunysb.edu', $subject, $message, 'From: Campus Dining - New Meal Plan Form <'.$posted['email']. '>');
	$body['response'] = '<p align="center">Your information is currently being processed.  Please allow up to 48 hours for a response.</p>';


}

$oTpl->assign($body);
$output = $oTpl->fetch($page.'.html');
?>

 

 

JAVASCRIPT

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo $title; ?></title>
<link href="style.css" rel="stylesheet" />
<script src="includes/js/core.js" type="application/javascript"></script>
<script type="text/javascript">
function getRadioValue (radioButtonOrGroup) {
  var value = null;
  if (radioButtonOrGroup.length) { // group 
    for (var b = 0; b < radioButtonOrGroup.length; b++)
      if (radioButtonOrGroup[b].checked)
        value = radioButtonOrGroup[b].value;
  }
  else if (radioButtonOrGroup.checked)
    value = radioButtonOrGroup.value;
  return value;
}

function getBudget(num)
{
if(num=="8")
{
	//alert('budget plan');
	window.location.href="https://secure.campusdining.org/ccf/newaccount/new_meal_pop.php?type=budget";
}
}

<!-- start hide
function info()
{
loc= document.mealselect.choose_mp.options[document.mealselect.choose_mp.selectedIndex].value

  	if ( (loc == "45") || (loc == "452") )
    {
    	window.open('terms_cond.php', 'popup3', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=380,height=260')
    }
}

function validateForm(form)
  {

if (!isEmail(form.email.value))
    {
    	alert("Please enter a valid Email address.");
	form.email.focus();
    return false;
    }    
    
if (isBlank(form.fname.value))
    {
    	alert("Please enter your First name.");
	form.fname.focus();
    return false;
    }

if (isBlank(form.lname.value))
    {
    	alert("Please enter your Last name.");
	form.lname.focus();
    return false;
    }

if ( (form.id1.value.length < 3) || (form.id2.value.length < 3) || (form.id3.value.length < 3) )
{
    	alert("Please enter your SUNY card ID #");
	form.id1.focus();
    return false;
    }


if ( isBlank(form.telephone1.value) || isBlank(form.telephone2.value) || isBlank(form.telephone3.value) )
    {
    	alert("Please enter your phone number.");
	form.telephone1.focus();
    return false;
    }

if ( (form.suny1.value.length<4) || (form.suny2.value.length<4) || (form.suny3.value.length<4)|| (form.suny4.value.length<4) )
{
    	alert("Please enter your SUNY card number");
	form.suny1.focus();
    return false;
    }
    
if (form.readcheck.checked)
    {   //if checked
    }else{
    	alert("Please check that you have read and understood the Meal Plan Information");
    return false;
}


  }  
  
  
  
function validateAddForm(form)
  {

    if (!isEmail(form.email.value))
    {
    	alert("Please enter a valid Email address.");
	form.email.focus();
    return false;
    }

if ((document.form2.addamount.options[document.form2.addamount.selectedIndex].value)=='amt'){
	alert("Please select an amount.");
	return false;
}
    
    if (isBlank(form.fname.value))
    {
    	alert("Please enter your First name.");
	form.fname.focus();
    return false;
    }

if (isBlank(form.lname.value))
    {
    	alert("Please enter your Last name.");
	form.lname.focus();
    return false;
    }

if ( (form.id1.value.length < 3) || (form.id2.value.length < 3) || (form.id3.value.length < 3) )
{
    	alert("Please enter your SUNY card ID #");
	form.id1.focus();
    return false;
    }

	if ( isBlank(form.telephone1.value) || isBlank(form.telephone2.value) || isBlank(form.telephone3.value) )
    {
    	alert("Please enter your phone number.");
	form.telephone1.focus();
    return false;
    }

if ( (form.suny1.value.length<4) || (form.suny2.value.length<4) || (form.suny3.value.length<4)|| (form.suny4.value.length<4) )
{
    	alert("Please enter your SUNY card number");
	form.suny1.focus();
    return false;
    }


if (form.readcheck.checked)
    {   //if checked
    }else{
    	alert("Please check that you have read and understood the Meal Plan Information");
    return false;
}


  }


function validateChangeForm(form)
  {

    if ( (getCheckedSelectOptions(form.current_mp) == 0) || (getCheckedSelectOptions(form.current_mp) == -1) )
    {
    	alert("Please select your current meal plan type.");
	form.current_mp.focus();
    	return false;
    }
    
    if ( (getCheckedSelectOptions(form.desired_mp) == 0) || (getCheckedSelectOptions(form.desired_mp) == -1) )
    {
    	alert("Please select your desired meal plan type or cancel meal plan.");
	form.desired_mp.focus();
    	return false;
    }
    	
if (isBlank(form.fname.value))
    {
    	alert("Please enter your First name.");
	form.fname.focus();
    return false;
    }

if (isBlank(form.lname.value))
    {
    	alert("Please enter your Last name.");
	form.lname.focus();
    return false;
    }

if ( (form.id1.value.length < 3) || (form.id2.value.length < 3) || (form.id3.value.length < 3) )
{
    	alert("Please enter your SUNY card ID #");
	form.id1.focus();
    return false;
    }

if ( isBlank(form.telephone1.value) || isBlank(form.telephone2.value) || isBlank(form.telephone3.value) )
    {
    	alert("Please enter your phone number.");
	form.telephone1.focus();
    return false;
    }

if ( (form.suny1.value.length<4) || (form.suny2.value.length<4) || (form.suny3.value.length<4)|| (form.suny4.value.length<4) )
{
    	alert("Please enter your SUNY card number");
	form.suny1.focus();
    return false;
    }
    
    if (!isEmail(form.email.value))
    {
    	alert("Please enter a valid Email address.");
	form.email.focus();
    return false;
    }

if (form.readcheck.checked)
    {   //if checked
    }else{
    	alert("Please check that you have read and understood the Meal Plan Information");
    return false;
}



  }   


function validateFormNew(form) {

if ((document.mealselect.frame.options[document.mealselect.frame.selectedIndex].value)=='x'){
 alert("Please select a semester.");
 return false;
}

if ((document.mealselect.choose_mp.options[document.mealselect.choose_mp.selectedIndex].value)=='nil'){
 alert("Please select a Meal Plan type.");
 return false;
}
  
    
}  
// end hide -->

</SCRIPT>
</head>
<body>
<div id="wrapper">
  <div id="header">
  	<div><img src="http://stonybrook.edu/pres/images/SB-band-wsearch.gif" alt="Stony Brook University Logo and Search Bar" width="800" height="33" border="0" usemap="#TopMap" /><map name="TopMap" id="TopMap">
      <area shape="rect" coords="5,1,242,28" href="http://stonybrook.edu" />
      <area shape="rect" coords="706,0,797,28" href="http://www.stonybrook.edu/sb/search.shtml"  alt="http://adam.cc.sunysb.edu:8765/" />
    </map></div>
    <div style="height:80px;"><img src="http://stonybrook.edu/pres/images/givingstrip.jpg" alt="Image of Students Walking On Campus" width="800" height="80" /></div>
    <div><img src="images/fsa_titlebar.gif" alt="Title Bar for Campus Dining" width="800" height="73" /></div>
  </div>
  <div>
    <ul id="nav">
    <li style="width: 90px;"><a href="index.php" class="programs">Home </a></li>
    <li style="width: 90px;"><a href="http://fsa.sunysb.edu/" class="programs">FSA </a>
    </li>
    <li class="rightfix" style="width: 170px;"><a href="#" class="programs">Community Services </a>
      <ul>
        <li><a href="http://fsa.sunysb.edu/?page=campus-services">Campus Services</a></li>
        <li class="step">Dining Services
        	<ul>
            	<li class="stepli"><a href="http://fsa.sunysb.edu/?page=hours">Where to Eat!</a></li>
            </ul>
        </li><!--
        <li class="step">Retail Services
        	<ul>
            	<li class="stepli"><a href="?page=retail">Main</a></li>
            	<li class="stepli"><a href="?page=retail-info">Product Information</a></li>

                <li class="stepli"><a href="?page=retail-apple">Apple Products</a></li>
                <li class="stepli"><a href="?page=leakeycollections">Leakey Collection</a></li>
                <li class="stepli"><a target="_blank" href="http://www.nydmv.state.ny.us/col.htm">License Plates</a></li>
            </ul>
        </li>-->
        <li><a href="http://fsa.sunysb.edu/?page=ssr">SSR Employment / Scholarship</a></li>
      </ul>
    </li>
    <li class="rightfix" style="width: 180px;"><a href="http://och.fsa.sunysb.edu/index.php" class="programs">Off Campus Housing </a>
      <ul>
      	<li><a href="http://och.fsa.sunysb.edu/"  target=_"blank">Home Page</a></li>
        <li><a href="http://och.fsa.sunysb.edu/index.php?page=housing"  target=_"blank">Rental Listings</a></li>
        <li><a href="http://och.fsa.sunysb.edu/index.php?page=roommates" target=_"blank">Roommate Search</a></li>
      </ul>
    </li>
    <li style="width: 120px;"><a href="http://shopsb.fsa.sunysb.edu/" class="receiving">RETAIL SERVICES</a>

      <ul>
      	<li><a href="http://fsa.sunysb.edu/?page=retail">Main</a></li>
        <li><a href="http://fsa.sunysb.edu/?page=retail-info">Product Information</a></li>
        <li><a href="http://fsa.sunysb.edu/?page=retail-apple">Apple Products</a></li>
        <li><a href="http://fsa.sunysb.edu/?page=leakeycollections">Leakey Collection</a></li>
        <li><a target="_blank" href="http://www.nydmv.state.ny.us/col.htm">License Plates</a></li>
        <li><a href="http://shopsb.fsa.sunysb.edu/index.php?categoryID=25"target=_"blank">Sales</a></li>
        <li><a href="http://shopsb.fsa.sunysb.edu/index.php?categoryID=30"target="_blank">Tickets</a></li>
        <li><a href="http://shopsb.fsa.sunysb.edu/index.php?categoryID=11"target="_blank">Fashion for Fridays</a></li>
      </ul>
    </li>
    <li><a href="http://www.campusdining.org/" class="receiving"target="_blank">CAMPUS DINING</a></li>
    <li style="width:15px; height:30px"> </li>
  </ul>

  </div>
  <div style="clear:both"></div>
  <div id="content">
    <div id="column_2">
      <div class="column_2_text">
[code]

Link to comment
https://forums.phpfreaks.com/topic/161819-php-form-headaches/#findComment-854580
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.