Computing.Net > Forums > Web Development > HTML Form Help

HTML Form Help

Reply to Message Icon

Original Message
Name: AndrewG1976
Date: September 27, 2005 at 16:31:01 Pacific
Subject: HTML Form Help
OS: SunOS 5.8
CPU/Ram: 440Mhz/512MB
Comment:

Hi,

I have a very simple HTML Form that allows input of an email address and posts the email address to an ASP for further processing. When someone enters their email address, I need to add single quotes around it when it is submitted. So for example if I enter someone@somewhere.com into the form, I need the form to post 'someone@somewhere.com' (note the quote marks) to the destination ASP page.

How can I do this?

My form code is:

--Begin Code--

<HTML>
<HEAD>
<TITLE>Unsubscribe Form</TITLE>
</HEAD>
<BODY>
<FORM name="myForm" action="http://myserver/unsubscribe.asp" method="post">

Please enter your Email Address below:</P>

<TEXTAREA style="WIDTH: 500px; HEIGHT: 20px" name="EmailAddress1" rows=1 cols=43 size="20"></TEXTAREA> </P>

<INPUT type="submit" value="Submit"></P></FORM>
</BODY>
</HTML>

--End Code--

Thanks,
Andrew


Report Offensive Message For Removal

Response Number 1
Name: Michael J (by mjdamato)
Date: September 27, 2005 at 21:06:36 Pacific
Subject: HTML Form Help
Reply: (edit)

You should handle those kind of conversions on the receiving end (i.e. the ASP page). But , if you really want to do it on the submitting page, then create a small javascript function and set the "action" of the form to the js function:
<FORM name="myForm" action="submitForm();" method="post">

The form will replace the value of the email field then actually submit the form:

function submitForm() {
field = document.myForm.EmailAddress1;
field.value = "'" + field.value + "'";
document.myForm.submit();
}


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: HTML Form Help

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software