Jump to content

Converting JavaScript to PHP


LaC0saNostra

Recommended Posts

Hello everybody. I have begun developing websites for the first time about 2 months ago. I have been learning so much and have gotten into HTML, XML, and JavaScript. I have now begun learning alot about PHP. As people are telling me it is very useful in website development. I made a sample website allowing a user to utilize a drop-down box to select a general feedback or help request form. Is there a way to convert my JavaScript part into PHP? I heard for server purposes this is a smart technique. I bolded where the JavaScript is. My code is as follows:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Edward Schubauer's Web Form</title>
<link href="dynamic_form_and_html_validation.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content ="text/html; charset=utf-8"/>
</head>
<body>
<div align="center">
<h1> My Personal Web Form</h1>
</div>
<p> I have been working diligently on this website. My portal page has some sample information and my CSS page has different examples of what concepts I have learned. At this point I would greatly appreciate if I could get some feedback on my webpage with the form below for you the user to fill out! Every person that gives me feedback will allow for vital information to improve the experience on this website. As always, your time will be greatly appreciated. Thank you. </p>
<div align="center">
<select name="URL" onchange="window.location.href=this.form.URL.options[this.form.URL.selectedIndex].value">
<option value="">Choose a form</option>
</select>
<input type="submit" value="Send" />
<input type="reset" value="Reset" />
</form>
</div>
<p>
src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
</p>
</body>
</html>

dynamic_form_and_html_validation.html

general_feedback_form.html

help_request_form.html

Link to comment
Share on other sites

I am certainly no Php expert but to me what you are are suggesting makes no sense. HTML files contain forms -- and Php files process forms, and the bolded section above is an HTML form. The form action should be a Php page. Now maybe you are talking about the form validation Javascript inside the attached files. Yes the Php file should perform validation of the form, but Php server-side validation is done __in addition to__ Javascript client-side validation -- they are both done. The client-side validation is intended to reduce the number of invalid forms that the server needs to process and also provide a quicker response to the user.

 

--EDIT--

 

Oh, that isn't really a form. All you want is a dropdown menu to provide redirection? You don't need a form or a form action or Php.

 <select onchange="location.assign(this.options[this.selectedIndex].value)">   <option value="">Choose a form</option>   <option value="f.html"> Go to File F </option>   <option value="r.html"> Go to File R </option> </select>
Link to comment
Share on other sites

If you're talking about using PHP to redirect someone based on a dropdown in a form, then the difference is that with PHP you need to submit the form to the server, PHP can get the value, and send a location header to redirect the user. Using Javascript doesn't require the form to be submitted to the server.

Link to comment
Share on other sites

Alright thank you for this advice guys. I think I was wording my question wrong. I wanted to use an if statement with a $_GET array so when the drop down box processes it uses PHP to go onto the server and re-direct the user. I am going to do a little bit more research though regarding what I am trying to accomplish before posting any more. Regardless I think your replies have set me straight on just exactly what I am trying to do here.

Link to comment
Share on other sites

The code I bolded below changed my file into a PHP file. I then changed the form method to "get." Now I just need to convert this into PHP code:
<select name="URL" onchange="window.location.href=this.form.URL.options[this.form.URL.selectedIndex].value">
<option value="">Choose a form</option>
</select>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Edward Schubauer's Web Form</title>
<link href="dynamic_form_and_html_validation.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content ="text/html; charset=utf-8"/>
</head>
<body>
<div align="center">
<h1> My Personal Web Form</h1>
</div>
<p> I have been working diligently on this website. My portal page has some sample information and my CSS page has different examples of what concepts I have learned. At this point I would greatly appreciate if I could get some feedback on my webpage with the form below for you the user to fill out! Every person that gives me feedback will allow for vital information to improve the experience on this website. As always, your time will be greatly appreciated. Thank you. </p>
<div align="center">
<select name="URL" onchange="window.location.href=this.form.URL.options[this.form.URL.selectedIndex].value">
<option value="">Choose a form</option>
</select>
<input type="submit" value="Send" />
<input type="reset" value="Reset" />
</form>
</div>
<p>
src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
</p>
</body>
</html>
Link to comment
Share on other sites

 

...Now I just need to convert this into PHP code:

 

 

As we said above -- that doesn't really make any sense. If all you want to do is redirection then it is more efficient to use Javascript. Php is used when you have a real form containing real data that needs to be submitted to the server, such as for a log-in, or for storage in a database.

 

You have created a form where there is no need for a form.

 

If you want to learn Php and learn what Php is for then go here...

 

http://www.w3schools.com/php/php_syntax.asp

Link to comment
Share on other sites

To be clear, Javascript and PHP are two different languages (albeit with similar syntax) that run in two different domains. Javascript is used to interact and respond to events in the browser based on user input, while PHP operates on the server, connecting and communicating with databases, the filesystem, and the like.

 

Through AJAX and / or forms, you can have Javascript communicate with PHP on the backed, but there's really no conversion process per se. You write the code for what the language / platform / domain supports.

Link to comment
Share on other sites

Well let's assume I want to create a drop-down box giving the user the opportunity to select either my general feedback form or my help request form. I want this all to happen communicating to the server. Would I utilize an "if" statement to accomplish this?

Link to comment
Share on other sites

That's a very vague question.

 

Likely there will be if statements regardless if how you architect it, but that's not really important. You really need to focus on what part needs to what. You would probably best be served by reading the PHP form documentation on w3schools.

 

If you want to toggle forms on a page for a user to submit, then do that with Javascript. When the form is submitted, then you would have PHP code to handle that. You could either have one PHP script per form, or one PHP script to handle both forms. It all depends on how you want it to work.

Link to comment
Share on other sites

I want to create a drop-down box giving the user the opportunity to select either my general feedback form or my help request form.

 

As TheScientist says, that is still a Javascript job. Now to RECEIVE, PROCESS and SAVE those forms on the SERVER -- you need Php.

Link to comment
Share on other sites

What I am trying to accomplish is to add a PHP script to this same page that checks if the $_GET array has a value for my select box defined. If my select field contents don't exist in the $_GET array, then the page should not display either type of my form. If a value for my select field is present in the $_GET array, then I want it to go to the forms I have.

 

So basically I need to first create the code in HTML and get rid of the JavaScript. This is for training purposes so I understand the concepts of PHP. I am going to be working with FTP server's and databases more so I want to get use to PHP.

Edited by LaC0saNostra
Link to comment
Share on other sites

you know Javascript can read the URI too...

http://stackoverflow.com/questions/5448545/how-to-retrieve-get-parameters-from-javascript

 

IMO, I would just have Javaacript check for the query params and load the page accordingly. Then your JS can just worry about the presentation logic, and PHP only has to deal with processing the form submissions.

Link to comment
Share on other sites

Ok guys after your advice and working on this for the past week this was what I am trying to accomplish. I have two seperate pages. The first page is:

 

<!-- Initial drop down menu -->
<?php
$menu_choice='null';
if(!empty($_GET['$menu_choice'])){
?>
showform(menu);
<?php
}
?>
<form name="menu" action="<?php echo $_SERVER['assignment5-2.php']?>" method="post">
<p>Please Choose a selection from the box below:
<SELECT id="form" name="menu_choice" size="1">
<OPTION value = "null"> </OPTION>
<OPTION value = "general_feedback">General Feedback </OPTION>
<OPTION value = "help_request">Help Request </OPTION>
</SELECT>
<input type ="SUBMIT" value"SELECT" name="select">
</p>
</form>
The second page is suppose to process the drop-down box:
<?php
$to="lac0sanostra11@gmail.com";
$cc=" ";
$subject="WSD: Assignment 5.2";
$referer = strtolower($_SERVER['HTTP_REFERER']);
if ($this_url != substr( $referer, 0, 19) ) {
echo "<h1>Error!</h1><p>You do not have permission to use this script from another URL.</p>";
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Dynamic Content</title>
<script language="JavaScript" type="text/javascript">
//<![CDATA[
var menu=NULL;
function showform(menu)
{var count = document.getElementById('form').selectedIndex;
var theoption = document.getElementById('form')[count].value;
if (theoption=="null")
{document.getElementById('feedform').style.visibility='hidden';
document.getElementById('helpform').style.visibility='hidden';
}
else if (theoption=="feed")
{document.getElementById('feedform').style.visibility='visible';
document.getElementById('helpform').style.visibility='hidden';
}
else if (theoption=="help")
{document.getElementById('helpform').style.visibility='visible';
document.getElementById('feedform').style.visibility='hidden';
}
else
{return;
}
}
<!-- Function to ensure fields have data -->
//]]>
</script>
<link href="style.css" type="text/css" rel="stylesheet">
<style type="text/css">
body
{
}
</style>
</head>
<body>
<?php
$name=$_POST['CustName'];
$address=$_POST['CustAddress'];
$city=$_POST['CustCity'];
$state=$_POST['CustState'];
$zip=$_POST['CustZipCode'];
$country=$_POST['CustCountry'];
$rate=$_POST['Rating'];
$from=$_POST['FromAddress'];
$message=$_POST['CustComment'];
As you can see I still have the Javascript involved but I feel it needs to be switched with "if" statements to go with the rest of my code. Maybe I wasn't explaining myself clearly when I first asked my question.
Link to comment
Share on other sites

You started out with two forms and one little drop-down menu and you seem to be utterly confused about what to do next. Those two forms can be easily combined along with the drop-down menu. See the file below. What you need to do is write form-to-email.php which is the Php file that both of these forms are sent to when they are submitted.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content ="text/html; charset=utf-8"/><title>Edward Schubauer's Web Form</title><style>td{border:1px dotted #aaa;}h1,h3{text-align:center;}#general_feedback_form, #help_request_form{display:none;}</style><script>window.onerror = function(m, u, l){alert('Javascript Error: '+m+'nURL: '+u+'nLine Number: '+l);return true;}</script><script>function change_visibility(){var sel = document.getElementById('menu_select');var x = sel.options[sel.selectedIndex].value;document.getElementById('general_feedback_form').style.display = 'none';document.getElementById('help_request_form').style.display = 'none';if(x!=""){document.getElementById(x).style.display = 'block';}}//end of functionfunction validateFeedForm(){var form1 = document.getElementById('feedform');	if (form1.CustName.value == "")	{		alert("A name must be entered.");		return false;	} 	if (form1.CustAddress.value == "")	{		alert("An address must be entered.");		return false;	}		if (form1.CustCity.value == "")	{		alert("A city must be entered.");		return false;	} 	if (form1.CustState.value == "")	{		alert("A state must be entered.");		return false;	} 	if (form1.CustZipCode.value == "")	{		alert("A zip code must be entered.");		return false;	} 	if (form1.CustCountry.value == "")	{		alert("A country code must be entered.");		return false;	} 	if (form1.CustComment.value == "")	{		alert("Please enter some sort of feedback for us.");		return false;	} }//end of functionfunction validateHelpForm(){var form1 = document.getElementById('helpform');   if (form1.Question.value == "")   {	alert("Question field cannot be empty.");	return false;   }    if (form1.Details.value == "")   {	alert("Details field cannot be empty.");	return false;   } 	   if (form1.CustName.value == "")   {	alert("A name must be entered.");	return false;   } 	   var contact = form1.contact;  // Name of input element   var count = 0;  // count is zero   for (i=0;i<contact.length;i++)  //loop through the contact checkboxes   {      if (contact[i].checked == true) // has the checkbox been ticked?      {         count += 1;  // The checkbox has been ticked so add 1 to the count      }   }    if (count == 0)  // if count is still zero then nothings been ticked.   {      alert("Please choose a method for us to contact you");      return false;   }}</script></head><body><div id="dynamic_select_menu"><h3>Select Form</h3><div style="text-align:center">   <select id="menu_select">   <option value="" selected>Choose a form</option>   <option value="general_feedback_form"> General Feedback</option>   <option value="help_request_form"> Help Request</option>   </select>   <input type="button" value="Select" onClick="change_visibility()"/></div></div><div id="general_feedback_form"><h1>General Feedback</h1><p> Please fill out this form with your feedback of my website. Without "you" the user, we cannot make the experience even better. I appreciate any constructive criticism as well. Thank you for your time  </p><form id="feedform" name="feedform" action="./form-to-email.php" method="post" onsubmit="return validateFeedForm();">        <input type="hidden" name="form_identity" value="feedback001" />	<table style="border:none;width:75%;min-width:700px;text-align:left">	<tr>	<td style="text-align:right"> E-mail:</td>	<td><input type="text" name="FromAddress" size="40"/></td>	<td rowspan="6">	Please rate my webpage: <br/><br/>	<input type="radio" name="Rating" id="strongly_dislike" value="Strongly Dislike" /> Strongly Dislike<br />	<input type="radio" name="Rating" id="dislike" value="Dislike" /> Dislike<br />	<input type="radio" name="Rating" id="like" value="Like" /> Like<br />	<input type="radio" name="Rating" id="strongly_like" value="Strongly Like" /> Strongly Like<br />	<input type="radio" name="Rating" id="love" value="Love" /> Love<br /><br />	</td>	</tr>	<tr>		<td align="right">Name: </td>		<td><input type="text" name="CustName" id="CustName" size="30"/></td>	</tr>	<tr>		<td align="right">Address: </td>		<td><input type="text" name="CustAddress" id="CustAddress" /> </td>	</tr>	<tr>		<td align="right">City: </td>		<td><input type="text" name="CustCity" id="CustCity" /> </td>	</tr>	<tr>		<td align="right">State: </td>		<td><input type="text" name="CustState" id="CustState" /> </td>	</tr>	<tr>		<td align="right">Zip Code: </td>		<td><input type="text" name="CustZipCode" id="CustZipCode" /> </td>	</tr>	<tr>		<td align="right">Country: </td>		<td><input type="text" name="CustCountry" id="CustCountry" /> </td>	</tr>	<tr>		<td colspan="2">Additional Feedback:<br />		<textarea rows="4" cols="60" name="CustComment" id="CustComment">Please enter any feedback that comes to mind.</textarea></td>	</tr>	<tr>		<td align="right"><input type="submit" value="Send" /></td>		<td><input type="reset" value="Reset" /></td>	</tr>	</table>	</form></div><div id="help_request_form"><h1>Help Request</h1><p> Do you have any specific questions you would like to ask us? Please do not shy in being honest. We personally reply to every question asked because our team believes that the users are what keep us going. As always, thank you.  </p><form id="helpform" name="helpform" action="./form-to-email.php" method="post" onsubmit="return validateHelpForm();">         <input type="hidden" name="form_identity" value="help001" />	<table style="border:none;width:75%;text-align:left;">		<tr>			<td>E-mail:</td>			<td><input type="text" name="FromAddress" size="40"/></td>		</tr>		<tr>			<td>How can we contact you?</td>			<td><input type="checkbox" name="contact" value="E-mail" />E-mail</td>		</tr>		<tr>			<td></td><td><input type="checkbox" name="contact" value="Phone" />Phone Number</td>					</tr>		<tr>			<td colspan="2">Question:<br />			<textarea rows="4" cols="60" name="Question"				id="Question">Briefly describe your question here</textarea></td>		</tr>		<tr>			<td colspan="2">Details:<br />			<textarea rows="12" cols="60" name="Details"				id="Details">Fill in the details here. Please be specific as possible</textarea></td>		</tr>			<tr>			<td>Name*</td>			<td><input type="text" name="CustName" id="CustName" size="40"/></td>		</tr>					<tr>			<td>Phone Number (optional)*</td>			<td><input type="text" name="CustNumber" id="CustNumber" size="40"></td>		</tr>				<tr>			<td align="right"><input type="submit" value="Submit"/></td>			<td><input type="reset" value="Reset" /></td>		</tr>		</table> 	</form></div></body></html>
Link to comment
Share on other sites

  • 3 weeks later...

Hey guys. I have been MIA but I finally can show you what I was trying to accomplish:

 <!DOCTYPE html><?php //variable to save what the user choose from the drop down$ddFormSelection="";  //start with it empty//step 1 was the form type selection submitted to this page via post?if (isset($_POST['ddFormSelection'])) { //step 2 - The user choose a form, set the variable $ddFormSelection = $_POST["ddFormSelection"];}//step 2 was a form submitted, to validateif(isset($_POST['hdnFormType'])){//a form type was submitted set our drop down variable to determine what validation to use and also//in case we have to redisplay the form again$ddFormSelection = $_POST["hdnFormType"];    $strErrorMessage="" ;//set variable for validation purposes$strSuccessMessage="" ;//set variable for validation purposes//validation for the feedback formif($ddFormSelection=="feedback"){//set variables we are validating for$txtEmailValue="";$txtNameValue="";$txtFeedbackValue="";//now set each variable based on what was passed in , this is used in the form html to set the value again in case validation fails.$txtEmailValue=$_POST["txtEmail"];$txtNameValue=$_POST["txtName"];$txtFeedbackValue=$_POST["txtAreaFeedback"];//testing to make sure we got the values, used for debugging//echo  "Email:" . $txtEmailValue . "</br>";//echo  "Name:" . $txtNameValue . "</br>";//echo  "Feedback:" . $txtFeedbackValue . "</br>";//now validate required fieldsif($txtNameValue==""){  $strErrorMessage .= "</br>You must enter your name";  //store error for name to variable}if($txtEmailValue==""){  $strErrorMessage .= "</br>You must enter an email address";  //store error for email to variable}if($txtFeedbackValue==""){  $strErrorMessage .= "</br>You must provide feedback";  //store error for feedback to variable}$message="Feedback message from : " . $txtNameValue . "<br/>Email" . $txtEmailValue .  "</br>Feedback:" . $txtFeedbackValue;  //set variable for the email body}//end feedback form validation if block//validation for help areaif($ddFormSelection=="help"){//set variables we are validating for$txtEmailValue="";$txtNameValue="";$txtFeedbackValue="";//now set each variable based on what was passed in , this is used in the form html to set the value again in case validation fails.$txtEmailValue=$_POST["txtEmail"];$txtNameValue=$_POST["txtName"];$txtddHelpType=$_POST["ddHelpType"];$txHelpValue=$_POST["txtAreaHelp"];//testing to make sure we got the values, used for debugging//echo  "Email:" . $txtEmailValue . "</br>";//echo  "Name:" . $txtNameValue . "</br>";//echo  "Feedback:" . $txtFeedbackValue . "</br>";//now validate required fieldsif($txtNameValue==""){  $strErrorMessage .= "</br>You must enter your name";  //store error for name to variable}if($txtEmailValue==""){  $strErrorMessage .= "</br>You must enter an email address";  //store error for email to variable}if($txtddHelpType=="choose"){  $strErrorMessage .= "</br>You must select what kind of help you want(pc,laptop,other)";  //store error for help message to variable}if($txHelpValue==""){  $strErrorMessage .= "</br>You must provide details of the help needed";  //store error for help message to variable}$message="Help message from : " . $txtNameValue . "<br/>Email" . $txtEmailValue . "</br>Help Request For:" . $txtddHelpType . "<br/>Message:" . $txHelpValue;  //set variable for the email body}//end help form validation if block//general validation for all forms, to prevent non authorized submissions to this form$referer = strtolower($_SERVER['HTTP_REFERER']);      $this_url = "http://cdlwebsysdev.esc-atsystems.net/";    if ($this_url != substr( $referer, 0, 38) ) {echo $strErrorMessage .="<br/>You do not have permission to use this script from another URL";}//did validation failif($strErrorMessage!=""){$strErrorMessage="Errors exist in your form submission, please correct the following:" . $strErrorMessage;}else{//send the email and thank the user$ToAddress = $_POST["ToAddress"];   $Subject = $_POST["Subject"];  $from = $txtEmailValue;//send email//echo $ToAddress . " " . $Subject . " " . $message ;mail($ToAddress,$Subject,$message);$strSuccessMessage ="Your message has been received, we will be in touch soon. Click <a href='sampledynamic.php'>Here to start over</a>";}}//end form submission if block?><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>    <title>Sample - Module 05 Assignment</title>    <meta charset="UTF-8">  <style>#error{color: #F03;}</style></head><body id="body"  >    <div id="main">   <h1> Sample PHP Selection w/ Validation </h1>        <?php//no options to choose form was sent through successfull        if($strSuccessMessage !=""){            echo $strSuccessMessage;           }              else{              ?>        <p> Step 1: How do you want to contact us?         </p>        <!--This section contains the drop down with php to remember the user selection--> <div id="formSelection">      <form  method="post" action="sampledynamic.php" id="frmSelect" name="frmSelect"> <label  for="ddFormSelection">Select:</label>    <select  id="ddFormSelection"  name="ddFormSelection"> <option <?php if ($ddFormSelection == "choose") { echo 'selected="selected"'; } ?> value="choose" >Please Select</option>   <option <?php if ($ddFormSelection == "help") { echo 'selected="selected"'; } ?> value="help">Help Request</option>  <option <?php if ($ddFormSelection == "feedback") { echo 'selected="selected"'; } ?> value="feedback">Feedback</option>     </select>          <input type="submit" value="Go"/>            </form>                    </div>        <!--end of drop down selection form-->              <!--error message error, used for either form-->       <div id="error">       <?php  echo $strErrorMessage ;  //only shows if there are errors?>               </div>              <!--Feedback form -->  <?php  //if feedback form was chosen write this html to the screen  if($ddFormSelection =="feedback"){ ?>        <div id="feedback">        <h2>Step 2: Fill out the below fields to send feedback</h2>            <form  method="post" action="sampledynamic.php" id="frmFeedback" name="frmFeedback">                  <label  for="txtName">Name:</label>                   <input type="text" id="txtName" name="txtName" size="30" maxlength="30"  value="<?php echo $txtNameValue; ?>" />                  <br/>                  <label  for="txtEmail">Email:</label>                   <input type="text" id="txtEmail" name="txtEmail" value="<?php echo $txtEmailValue; ?>" size="30" maxlength="30"/>                  <br/>                                  <label  for="txtAreaFeedback">Feedback:</label>                   <textarea id="txtAreaFeedback" name="txtAreaFeedback" rows="10" cols="50"><?php echo $txtFeedbackValue;?></textarea>                  </br>                <input type="hidden" name="ToAddress" value="todd@redrockcom.com" />           <input type="hidden" name="Subject" value="Feedback from Dynamic Content Sample" />                <!--use the below hidden field to know if we need to validate and what form to validate-->                <input type="hidden" name="hdnFormType" id="hdnFormType" value="feedback"/>  <input type="submit" value="Send Feedback"/>                 </form>        </div>  <!--end of feedback form--><?php}//end of if block to display feedback form?>   <?php  //if feedback form was chosen write this html to the screen  if($ddFormSelection =="help"){ ?>        <div id="feedback">        <h2>Step 2: Fill out the below fields to send a help request</h2>            <form  method="post" action="sampledynamic.php" id="frmHelp" name="frmHelp">                  <label  for="txtName">Name:</label>                   <input type="text" id="txtName" name="txtName" size="30" maxlength="30"  value="<?php echo $txtNameValue; ?>" />                  <br/>                  <label  for="txtEmail">Email:</label>                   <input type="text" id="txtEmail" name="txtEmail" value="<?php echo $txtEmailValue; ?>" size="30" maxlength="30"/>                  <br/>                    <label  for="ddHelpType">What kind of help:</label> <select  id="ddHelpType"  name="ddHelpType">  <option <?php if ($txtddHelpType == "choose") { echo 'selected="selected"'; } ?> value="choose" >Please Select</option>   <option <?php if ($txtddHelpType == "pc") { echo 'selected="selected"'; } ?> value="pc">PC</option>  <option <?php if ($txtddHelpType == "laptop") { echo 'selected="selected"'; } ?> value="laptop">Laptop</option>      <option <?php if ($txtddHelpType == "other") { echo 'selected="selected"'; } ?> value="other">Other</option>   </select>                            <br/>                  <label  for="txtAreaHelp">Details of help needed:</label>                   <textarea id="txtAreaHelp" name="txtAreaHelp" rows="10" cols="50"><?php echo $txHelpValue;?></textarea>                  </br>                <input type="hidden" name="ToAddress" value="todd@redrockcom.com" />           <input type="hidden" name="Subject" value="Help from Dynamic Content Sample" />                <!--use the below hidden field to know if we need to validate and what form to validate-->                <input type="hidden" name="hdnFormType" id="hdnFormType" value="help"/>  <input type="submit" value="Send Help Request"/>                 </form>        </div>  <!--end of feedback form--><?php}//end of if block to display feedback form?>                     <?php }//end if successful if block ?>        </div>    </body></html>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...