Jump to content

Need to reset the displayed functions


ssurya

Recommended Posts

function my_fav_quote_show_optin_form() {	

if (!empty($_POST['my_fav_quote_email'])) {

	my_fav_quote_opt_in();
}
	$out2 = '';

	$out = '<form action="" name="myform "method="post" id="requestQuote">';
	$out .= '<table style="padding="0px" width="40px">';
	$out .= '<tr><td>Name:*</td><td><input type="text" name="my_fav_quote_name" id="my_fav_quote_name"/></td></tr>';
	$out .= '';
	$out .= '<tr><td>Email:*</td><td><input type="text" name="my_fav_quote_email" id="my_fav_quote_email"/></td></tr>';

$out .= '';
	$out .= '<tr><td>Phone:*</td><td><input type="text" name="my_fav_quote_phone" id="my_fav_quote_phone"/></td></tr>';

$out .= '';

$out .= '<tr><td>Event Date(optional):</td><td><input type="text" name="my_fav_quote_date" id="my_fav_quote_date"/></td></tr>';
	$out .= '';

$out .= '<tr><td>Estimated Number of Guests(optional):</td><td><input type="text" name="my_fav_quote_guest" id="my_fav_quote_guest"/></td></tr>';
	$out .= '';

$out .= '<tr><td>Desired Price Range Per Person (optional):</td><td><input type="text" name="my_fav_quote_rate" id="my_fav_quote_rate"/></td></tr>';
	$out .= '';
	$out .= '<tr><td style="vertical-align: middle;">Message:<br>(List your special requests, any food allergies , event description , special menu items that are not listed or any other information you think will helpful) </td><td><textarea placeholder=""  name="my_fav_quote_message" id="my_fav_quote_message"></textarea></td></tr>';
	$out .= '';
	$out .= '<tr><td>Security code:*</td><td><img src='.get_bloginfo('wpurl').'/wp-content/plugins/quote-cart/captcha.php?width=60&height=30&characters=5" /></td></tr>';
	$out .= '';
	$out .= '<tr><td>Input Above Security Code Here:*</td><td><input type="text" name="security_code" id="security_code" size="5"></td></tr>';
	$out .= '';

	$out .='<tr><td colspan="2">';
	if ( function_exists( 'my_fav_quote_display' ) ){
		$out .= my_fav_quote_display();
	}



	if ( function_exists( 'my_fav_quote_display3' ) ){
		$out .= my_fav_quote_display3();
	}


	$out .='</td></tr>';
	$out .= '<tr><td colspan=2 align=center><input type="submit" value="Request Quote" onclick="return chk_validation()" style="background-color:#000;color:#FFF;padding:5px;margin-top:10px;border:none;cursor:pointer;"/>  
	<input type="button" onclick="formReset()" value="Reset form" />

</td></tr>';

	$out .='</table></form>';
	echo $out;
	?>
		<script language="javascript" type="text/javascript">
	//<![CDATA[
			function validate_email(field,alerttxt)
			{

			  apos=field.indexOf("@");
			// alert(apos);
			  dotpos=field.lastIndexOf(".");
			   //alert(dotpos);
			  if (apos<1||dotpos-apos<2)
				{ return false;}
			  else {return true;}
			  
			}
			function chk_validation()
			{
				if(document.getElementById("my_fav_quote_name") && document.getElementById("my_fav_quote_name").value == '')
				{
					alert("Please Enter Name");
					document.getElementById("my_fav_quote_name").focus();
					return false;
				}

				if(document.getElementById("my_fav_quote_email").value == '')
				{
					alert("Please Enter Email");
					document.getElementById("my_fav_quote_email").focus();
					return false;
				}
				else
				{

				//alert(validate_email(document.getElementById("my_fav_quote_email").value,"Not a valid e-mail address!");
					if (validate_email(document.getElementById("my_fav_quote_email").value,"Please enter valid e-mail address!")==false)						{
					alert("Please enter valid e-mail address!");
					document.getElementById("my_fav_quote_email").focus();
					return false;
					}
				}
				if(document.getElementById("security_code").value == '')
				{
					alert("Please Enter Security Code");
					document.getElementById("security_code").focus();
					return false;
				}
				if(document.getElementById("quotes").value == '')
				{
					alert("Please add atleast one request quote");
					document.getElementById("quotes").focus();
					return false;
				}
				//return true;
			}



			//]]>

		</script>
<?php

}

 

i need a form reset the actual problem is the normal reset is only reseting the fields but i need the information displayed using functions should also be reseted

 

 

Link to comment
https://forums.phpfreaks.com/topic/251480-need-to-reset-the-displayed-functions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.