Jump to content

form not working correctly in email


Mick Wansey

Recommended Posts

Ok I have generatend a form using a free form generator and it all works fine except for one thing that went I go to post it and the email client comes up it is all on one line and very difficult to read? Why is this so.Here is a copy of the formThankyou in advanceThis is what it looks like in the emailFirst_Name=steve&Last_Name=Wan&Address=Full+Address+including+state+and+area+code&E-mail=fire%40hotmail.com&Home_Phone=02+636000001&Mobile_Phone=040000000&Quantity=2&submit=Order<script language='javascript'>function verifyMe(){var msg='';if(document.getElementById('fname').value==''){ msg+='- First Name\n\n';}if(document.getElementById('lname').value==''){ msg+='- Last Name\n\n';}if(document.getElementById('paddy').value==''){ msg+='- Postal Address\n\n';}var email=document.getElementById('email').value;if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))){msg+='- Invalid Email Address: '+email+'\n\n';}if(document.getElementById('email').value==''){ msg+='- E-Mail\n\n';}if(document.getElementById('hphone').value==''){ msg+='- Home Phone\n\n';}if(document.getElementById('mphone').value==''){ msg+='- Mobile Phone\n\n';}if(document.getElementById('qty').value==''){ msg+='- Quantity\n\n';}if(msg!=''){ alert('The following fields are empty or invalid:\n\n'+msg); return false}else{ return true }}</script><form name='Order Form' action='submit form' method='POST' enctype='application/x-www-form-urlencoded' onsubmit='return verifyMe();'><table class='table_form_1' id='table_form_1' cellspacing='0'> <tr> <td class='ftbl_row_1' ><LABEL for='fname' ACCESSKEY='none' ><b style='color:red'>*</b>First Name </td> <td class='ftbl_row_1a' ><input type='text' name='fname' id='fname' size='36' maxlength='36' value=''> </td> </tr> <tr> <td class='ftbl_row_2' ><LABEL for='lname' ACCESSKEY='none' ><b style='color:red'>*</b>Last Name </td> <td class='ftbl_row_2a' ><input type='text' name='lname' id='lname' size='36' maxlength='36' value=''> </td> </tr> <tr> <td valign='top' class='ftbl_row_1' ><LABEL for='paddy' ACCESSKEY='none' ><b style='color:red'>*</b>Postal Address </td> <td class='ftbl_row_1a' ><textarea name='paddy' id='paddy' cols='29' rows='6' value='Full Address including state and area code'>Full Address including state and area code</textarea> </td> </tr> <tr> <td class='ftbl_row_2' ><LABEL for='email' ACCESSKEY='none' ><b style='color:red'>*</b>E-Malil </td> <td class='ftbl_row_2a' ><input type='text' name='email' id='email' size='36' maxlength='36' value=''> </td> </tr> <tr> <td class='ftbl_row_1' ><LABEL for='hphone' ACCESSKEY='none' ><b style='color:red'>*</b>Home Phone </td> <td class='ftbl_row_1a' ><input type='text' name='hphone' id='hphone' size='36' maxlength='36' value=''> </td> </tr> <tr> <td class='ftbl_row_2' ><LABEL for='mphone' ACCESSKEY='none' ><b style='color:red'>*</b>Mobile Phone </td> <td class='ftbl_row_2a' ><input type='text' name='mphone' id='mphone' size='36' maxlength='36' value=''> </td> </tr> <tr> <td class='ftbl_row_1' ><LABEL for='qty' ACCESSKEY='none' ><b style='color:red'>*</b>Quantity </td> <td class='ftbl_row_1a' ><input type='text' name='qty' id='qty' size='36' maxlength='3' value=''> </td> </tr> <tr> <td colspan='2' align='right'><input type='submit' name='submit' value='Submit'> <input type='reset' name='reset' value='Reset'><br /><a href='http://www.formgenics.com' style='font-family:arial;font-size:10px;color:#C0C0C0;text-decoration:none'>powered by FormGenics.com</a> </td> </tr></table></form>

Link to comment
Share on other sites

if you don't want the mail opening up with an email client, you should look into using a server-side language, like PHP's mail function. Essentially you modify the action property of your form to a php page that takes the incoming form values (that one really long line you're seeing) and constructs an email out of them and then sends it.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...