469,317 Members | 1,679 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,317 developers. It's quick & easy.

Need help for creatin enquiry form

Hi to All.
I am Punit Shrivastava.I am working in Asp.As i am new in this technology please help me.
I want to create enquiry form in Asp.
For this i code like this:
Expand|Select|Wrap|Line Numbers
  1. <form name="enquiry" method="post"  action="enquiry.php">
  2.  
  3.         <table width="494" border="0" cellspacing="0" cellpadding="2" height="511">
  4.             <tr>
  5.                 <td colspan="2" align="left" valign="top" height="29">
  6.                 <p align="left"><font face="Verdana" color="#FFFFFF">Fields marked with * are mandatory 
  7.                 </font></td>
  8.             </tr>
  9.             <tr>
  10.                 <td align="left" valign="top" bgcolor="#FFFFFF" height="27">
  11.                 <font face="Verdana" size="2">Title *</font></td>
  12.                 <td align="left" valign="top" bgcolor="#FFFFFF" height="27">
  13. <font face="Verdana" size="3">
  14. <select name="ddlTitle" id ="ddlTitle" size="1" style="border: 1px solid #315D10" tabindex="1">
  15.                 <option value="Mr">Mr</option>
  16.                 <option value="Mrs">Mrs</option>
  17.                 <option value="Ms">Ms</option>
  18.                 <option value="Miss">Miss</option>
  19.                 <option value="Dr">Dr</option>
  20.                 </select></font></td>
  21.             </tr>
  22.             <tr>
  23.                 <td align="left" valign="top" bgcolor="#FFFFFF" height="25">
  24.                 <font face="Verdana" size="2"><label for="firstname">First Name *</label></font></td>
  25.                 <td align="left" valign="top" bgcolor="#FFFFFF" height="25">
  26.                 <font face="Verdana"><font face="Verdana" size="3">
  27.                 <input type="text" name="txtFirstName" id ="txtFirstName" size="25" maxlength="30" style="border: 1px solid #315D10" tabindex="2"></font><font size="2">
  28.                 </font></font>
  29.                           </td>
  30.             </tr>
  31.             <tr>
  32.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  33.                 <font face="Verdana" size="2"><label for="lastname">Last Name *</label></font></td>
  34.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  35.         <font face="Verdana"><font face="Verdana" size="3">
  36.         <input type="text" name="txtLastName" id ="txtLastName" size="25" style="border: 1px solid #315D10" tabindex="3"></font><font size="2">
  37.         </font></font>
  38.                           </td>
  39.             </tr>
  40.             <tr>
  41.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  42.                 <font face="Verdana" size="2"><label for="postaladdress">Postal Address *</label></font></td>
  43.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  44.                 <font face="Verdana"><font face="Verdana" size="3">
  45. <textarea name="txtPostalAddress" id ="txtPostalAddress" cols="22" wrap="VIRTUAL" rows="3" style="border: 1px solid #315D10" tabindex="5"></textarea><font size="2">
  46.                 </font></font>
  47.                           </td>
  48.             </tr>
  49.             <tr>
  50.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  51.                 <font face="Verdana" size="2"><label for="town">Town</label></font></td>
  52.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  53. <font face="Verdana" size="3"><input type="text" name="txtTown" size="25" style="border: 1px solid #315D10" tabindex="6"></font></td>
  54.             </tr>
  55.             <tr>
  56.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  57.                 <font face="Verdana" size="2"><label for="pincode">Pin code</label></font></td>
  58.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  59.                 <font size="2" face="Verdana">
  60.                 <input type="text" name="txtPinCode" size="25" style="border: 1px solid #315D10" tabindex="7"></font></font></td>
  61.             </tr>
  62.  
  63.             <tr>
  64.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  65.                 <font face="Verdana" size="2"><label for="country">Country</label></font></td>
  66.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  67.                 <font face="Verdana"><font face="Verdana" size="3">
  68.                 <input type="text" id="country" name="txtCountry" size="25" style="border: 1px solid #315D10" tabindex="8"></font><font size="2">
  69.                 </font></font>
  70.                           </td>
  71.             </tr>
  72.             <tr>
  73.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  74.                 <font face="Verdana" size="2"><label for="telephone">Telephone *</label></font></td>
  75.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  76. <font face="Verdana"><font face="Verdana" size="3">
  77. <input type="text" name="txtTelephone" id ="txtTelephone" size="25" maxlength="14" style="border: 1px solid #315D10" tabindex="9"></font><font size="2">
  78. </font></font>
  79.                           </td>
  80.             </tr>
  81.             <tr>
  82.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  83.                 <font face="Verdana" size="2"><label for="fax">Fax</label></font></td>
  84.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  85.                 <font face="Verdana"><font face="Verdana" size="3">
  86.                 <input type="text" name="txtFax" size="25" style="border: 1px solid #315D10" tabindex="10"></font><font size="2">
  87.                 </font></font>
  88.                           </td>
  89.             </tr>
  90.             <tr>
  91.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  92.                 <font face="Verdana" size="2"><label for="email">E-mail 
  93.                 *</label></font></td>
  94.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  95.                 <font face="Verdana"><font face="Verdana" size="3">
  96.                 <input type="text" name="txtEmail" id ="txtEmail" size="25" style="border: 1px solid #315D10" tabindex="11"></font><font size="2">
  97.                 </font></font>
  98.                           </td>
  99.             </tr>
  100.             <tr>
  101.                 <td align="left" bgcolor="#FFFFFF">
  102.                 <font face="Verdana" size="2"><label for="comments">Your Enquiry</label></font></td>
  103.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  104.                 <font face="Verdana"><font face="Verdana" size="3">
  105.                 <textarea name="txtYourEnquiry" cols="30" rows="8" wrap="VIRTUAL" style="border: 1px solid #315D10" tabindex="12"></textarea></font><font size="2">
  106.                 </font></font>
  107.                          </td>
  108.             </tr>
  109.             <tr>
  110.                 <td bgcolor="#FFFFFF">&nbsp;</td>
  111.                 <td align="left" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
  112.             </tr>
  113.             <tr>
  114.                 <td bgcolor="#FFFFFF">&nbsp;</td>
  115.                 <td align="left" valign="top" bgcolor="#FFFFFF">
  116.                 <font face="Verdana"><font face="Verdana" size="3">
  117.                 <input type="submit" name="btnSubmit" value="Submit" style="border:1px solid #315D10; " onclick = "return Validate();"  tabindex="13"></font><font size="2"> &nbsp; &nbsp; &nbsp; &nbsp;
  118.  
  119.  
  120.  
  121.                 </font><font face="Verdana" size="3">
  122.  
  123.  
  124.  
  125.                 <input type="reset" name="btnReset" value="Reset" style="border: 1px solid #315D10" tabindex="14"></font><font size="2">
  126.                 </font></font>
  127.                         </td>
  128.             </tr>
  129.             <tr>
  130.                 <td bgcolor="#FFFFFF">&nbsp;</td>
  131.                 <td align="left" valign="top" bgcolor="#FFFFFF">&nbsp;
  132.                 </td>
  133.             </tr>
  134.         </table>
  135.     </form>

And For enquiry.asp i code like this:
Expand|Select|Wrap|Line Numbers
  1. <% 
  2.  
  3. Title = request.form("ddlTitle")
  4.  
  5. FirstName = request.form("txtFirstName")
  6.  
  7. LastName = request.form("txtLastName")
  8.  
  9. PostalAddress = request.form("txtPostalAddress")
  10.  
  11. Town = request.form("txtTown")
  12.  
  13. PinCode = request.form("txtPinCode")
  14.  
  15. Country = request.form("txtCountry")
  16.  
  17. Telephone = request.form("txtTelephone")
  18.  
  19. Fax = request.form("txtFax")
  20.  
  21. Email = request.form("txtEmail")
  22.  
  23. YourEnquiry = request.form("txtYourEnquiry")
  24.  
  25.  
  26.  
  27. mes= mes & "<b>Title:- </b>" & Title & "<br>"
  28. mes= mes & "<b>First Name:- </b>" & FirstName & "<br>"
  29. mes= mes & "<b>Last Name:- </b>" & LastName & "<br>"
  30. mes= mes & "<b>Postal Address:- </b>" & PostalAddress & "<br>"
  31.  
  32. mes= mes & "<b>Town:- </b>" & Town & "<br>"
  33.  
  34. mes= mes & "<b>Pin Code:- </b>" & PinCode & "<br>"
  35.  
  36. mes= mes & "<b>Country:- </b>" & Country & "<br>"
  37.  
  38. mes= mes & "<b>Telephone :- </b>" & Telephone & "<br>"
  39.  
  40. mes= mes & "<b>Fax :- </b>" & Fax & "<br>"
  41.  
  42. mes= mes & "<b>Email :- </b>" & Email & "<br>"
  43.  
  44. mes= mes & "<b>YourEnquiry:- </b>" & YourEnquiry & "<br>"
  45.  
  46.  
  47.  
  48. dim myMail
  49. Set myMail = Server.CreateObject("CDO.Message")
  50. myMail.Subject= "enquiryform"
  51. myMail.From = email
  52. myMail.To= "maninder@xcelcom.net"
  53. myMail.HTMLBody = mes
  54. On Error Resume Next
  55. myMail.Send
  56. set myMail = nothing
  57. IF Err <> 0 THEN
  58. Response.Redirect"Error.html"
  59. ELSE
  60. Response.Redirect"Success.html"
  61. END IF
  62. %>
but is not working .It is showing error .Please suggest me what I do.As i am new in Asp .Please suggest me what i do.

Thanks & Regards
Punit Shrivastava
Sep 22 '07 #1
2 4099
jhardman
3,406 Expert 2GB
Punit,

What is the error it is giving you?

Jared
Sep 24 '07 #2
briony
1
I am Punit Shrivastava.I am working in Asp.As i am new in this technology please help me.I want to create enquiry form in Asp.
For this i code like this:
[code=html]<form name="enquiry" method="post" action="enquiry.php">[code]
> Okay,.. i didnt actually run-test your code,.. but from the first line .. I say this php statement.. did you mentioned ASP? orr.. php..?

> Secondly, from your enquiry.asp form.. I think the numbering you made will results in error since the script actually read it as a part of the code.. I suggest you remove the numebring on enquiry.asp pages.. see what happen, if you still encounter with error.. then you can paste the error message displayed.. and let us try to assist you base on that.

Happy coding! ;)
Sep 30 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Hermit Dave | last post: by
1 post views Thread by shalender verma | last post: by
reply views Thread by gnawz | last post: by
KeredDrahcir
6 posts views Thread by KeredDrahcir | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.