Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - How do I add new field to the form
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How do I add new field to the form

 Post Reply Post Reply Page  123>
Author
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Topic: How do I add new field to the form
    Posted: 14 June 2005 at 12:36am
I found the manual for persist aspEmail..
 
Everything works as expected.. except I want to have more than just subject, and body..I'm trying to creat a feedback form on my sit..
 
how can I add fields like check box, extra text field, drop down menu to the form, and able to receive the result.
 
I found the script on this page...
 
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2005 at 2:43am
checkboxes etc cane be put in using html tags... do a google search for forms and html...
Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2005 at 3:45pm
as long as they are within the same form it should work, right?
 
That's what I did, and it didn't work..
 
I just added a set a checkbox.. but I don't see the result of the box I checked in my email.. I only see subject and body
 
<HTML>
<BODY BGCOLOR="#FFFFFF">
<FORM METHOD="POST" ACTION="Simple.asp">
<TABLE CELLSPACING=0 CELLPADDING=2 BGCOLOR="#E0E0E0">
<TR>
   <TD>Body:</TD>
   <TD><TEXTAREA NAME="Body"></TEXTAREA></TD>
</TR>
<TR>
  <TD COLSPAN=2><input type="text" name="subject"></TD>
</TR>
<TR>
  <TD COLSPAN=2><input type="checkbox" name="checkbox" value="Misspell">
    <input type="checkbox" name="checkbox" value="Miss">
    <input type="checkbox" name="checkbox" value="incorrect">
    <input type="checkbox" name="checkbox" value="link"></TD>
</TR>
<TR>
   <TD COLSPAN=2><INPUT TYPE="SUBMIT" NAME="Send" VALUE="Send Message">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>


Edited by Lucent - 14 June 2005 at 4:21pm
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2005 at 6:47pm
well you have to change the mailer code so that it also writes the value of the checked box... somewhere in the body part of the email code you would have to include
 
"Checkbox: " & request.form("checkbox")
Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2005 at 7:49pm
I tried.. it shows 500 error Internal server error
 
================================
 
<%
' change to address of your own SMTP server
strHost = "mail.mydoman.com"
If Request("Send") <> "" Then
   Set Mail = Server.CreateObject("Persits.MailSender")
   ' enter valid SMTP host
   Mail.Host = strHost

   Mail.From = report@mydomain.com
   Mail.FromName = "123"
   Mail.AddAddress ("rt@mydomain.com")

   Mail.Subject = Request("Subject")
   Mail.Body = Request("Body")
   "Checkbox: " & request.form("checkbox")
   strErr = ""
   bSuccess = False
   On Error Resume Next ' catch errors
   Mail.Send ' send message
   If Err <> 0 Then ' error occurred
      strErr = Err.Description
   else
      bSuccess = True
   End If
End If
%>
<% If strErr <> "" Then %>
<h3>Error occurred: <% = strErr %>
<% End If %>
<% If bSuccess Then %>
Success! Message sent to <% = Request("To") %>.
<% End If %>

=================================
 
I also tried...
 
Mail.checkbox = Request("checkbox")

 
but it still doesn't work


Edited by Lucent - 14 June 2005 at 7:50pm
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2005 at 8:01pm
use
Mail.Body = request("Body") & vbcrlf & vbcrlf & "Checkbox: " & request.form("checkbox")
 
It's not actually in the body section as you have it above.
 
Also, goto tools>internet options>advanced tab and then deselect "show friendly http error messages." This will tell you what the error actually is (usually) instead of the generic server internal 500...
 
Also, where are you getting "body" and "subject" from?
Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2005 at 11:33pm

thank you it works!!

by the way.. what is vbcrlf?

How can I use it if I want to add other fields like text, drop down, radio button..etc...?
Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2005 at 11:39pm
Also another question..
 
My email form also has mail.username and mail.password.. just wondering..
 
now I have
sendmail.asp (email code)
feedback.asp (feedback form)
 
I know asp is client side script and it turns into html.. but can anyone ever retrive my username and password from my asp file?
Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.