473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using a form item as a variable

toxicpaint
Hi there.

I can't seem to work out what I'm doing wrong here and I was wondering if you could help.

I have a form to submit a question, but as the questions vary in nature, I want them to go to 3 or more e-mail addresses. I'm using a drop down menu to select the type of question the user wants to ask then using this to determine what e-mail address to pick.

The cgi on the server is configured to only send an e-mail if the "mailto" field is filled, which is the problem as something's going wrong!

Here's the code:

[HTML]<script language="javascript">
function check_email(){
if (document.makingContact.enquiry.value = "general"){
document.makingContact.mailto.value="email1@liv.ac .uk"
}

if (document.makingContact.enquiry.value = "feedback"){
document.makingContact.mailto.value="email2@liv.ac .uk"
}

if (document.makingContact.enquiry.value = "student"){
document.makingContact.mailto.value="email3@liv.ac .uk"
}

}
</script>

<FORM name=makingContact action="http://www.liv.ac.uk/cgi-bin/mailcomments.cgi" method="post">
<input name="mailto" type="hidden" value="">
<input name="subject" type="hidden" value="Web Enquiry">
<input name="required" type="hidden" value="email">
<input name="response" type="hidden" value="<H2>Submission Sucessful!</H2><br><P>Thank you for your submission</P>" id="">
<TABLE class=tableborderzero style="WIDTH: 512px; HEIGHT: 256px" cellSpacing=2 cellPadding=2 align=left summary="" border=0 cmid="GalleryPage:Copy">
<TBODY>
<TR cmid="GalleryPage:Copy">
<TD cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Enquiry Type</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><SELECT id=enquiry name=enquiry onMouseClick="check_email()"> <OPTION value="general"
>General Enquiry</OPTION> <OPTION value="feedback">Leave
Feedback</OPTION> <OPTION value="student">Student Information</OPTION></SELECT></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Forename</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><INPUT id=forename value=forename name=forename></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Surname</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><INPUT id=surname value=surname name=surname></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">E-mail Address</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><INPUT id=email size=30 value=email name=email></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero vAlign=top cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Home

Address</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><TEXTAREA id=homeaddress style="WIDTH: 333px; HEIGHT: 118px" name=homeaddress

rows=7 cols=34></TEXTAREA></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero vAlign=top cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Request</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><TEXTAREA id=request style="WIDTH: 335px; HEIGHT: 116px" name=request rows=5

cols=18></TEXTAREA></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"></TD>
<TD class=tableborderzero cmid="GalleryPage:Copy"><BR><INPUT id=submit type=submit value=Submit

name=Submit>&nbsp;<INPUT id=reset type=reset value=Reset name=reset></TD>
<TD colSpan=2 cmid="GalleryPage:Copy"></TD></TR></TBODY></TABLE></FORM>[/HTML]
Nov 20 '06 #1
5 1805
AricC
1,892 Expert 1GB
I don't see your <select> tags anywhere the javascript looks fine from here post your <select><option>...</option></select> to see if the problem is there.
Nov 20 '06 #2
AricC
1,892 Expert 1GB
Nevermind I see it. I think the problem is your using onMouseClick use onclick="SomeJavascriptFunction();" there is no onMouseClick in Javascript.

HTH,
Aric
Nov 20 '06 #3
Thanks a lot!
Feb 27 '07 #4
acoder
16,027 Expert Mod 8TB
Thanks a lot!
Whoa! It took you a long time to get back!

Better late than never, eh?!
Feb 27 '07 #5
My sentiments exactly. ;)
Mar 13 '07 #6

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

Similar topics

2
by: Varun Singal | last post by:
Hi I am calling .NET components from my Classical ASPs. For this I strong named my assemblies, then registered them in the resistry ( using RegAsm), and put them in GAC (using GacUtil) ....
3
by: Nick | last post by:
I have a form that has several check boxes defaulting to checked. When the form loads, I have a cursor looping through a table that stores the name of the check boxes that need to be unchecked. ...
17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
3
by: pjcraig | last post by:
This is driving me crazy! I have a form that a user will access from another form by selecting the item that they wish to view. When they open the new form, I pass through the id of the item they...
13
by: Deano | last post by:
Apparently you can only do this with one value i.e Call MyAssetLocationZoom(Me!txtLocation, "Amend data") This runs; Public Sub MyAssetLocationZoom(ctl As Control, formName As String) On...
2
by: Roshawn | last post by:
Hi, On my asp.net page I have an html form. I've set runat attribute to server and filled it with server controls. All settings are as I like them. So here's the problem: when I perform a...
5
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but...
4
by: [Jongware] | last post by:
I have a large table in XML, of the form (simplified) <item><a>data1</a><b>more 1</b></item> <item><a>data1</a><b>more 2</b></item> <item><a>data2</a><b>more 3</b></item> -- where I want the...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
2
by: viki1967 | last post by:
Hi there. I have a problem in to recover the values of a dynamic form. The form is this: strSQL = "SELECT * " strSQL = strSQL & " FROM " strSQL = strSQL & " TBL "
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.