Back to myContactForm.com - Easy email form creation and processing for your web site
myContactForm.com - Help Forum Forum Index myContactForm.com - Help Forum
Have a question that you need answered about myContactForm.com? Post it on this message board but first search this forum and read out FAQ to ensure it has not already been answered. This is not a board to post links to your site! SPAM will be deleted!
 
   Search MessagesSearch Messages
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

2nd dropdown dynamically filled javascript/not in email

 
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Form Management
View previous topic :: View next topic  
Author Message
protectmyvehicle



Joined: 09 Dec 2018
Posts: 1

PostPosted: Tue Dec 18, 2018 9:05 am    Post subject: 2nd dropdown dynamically filled javascript/not in email Reply with quote

I am using a javascript to dynamically fill my second dropdown in form based on selection from first dropdown. I have got it to work correctly but the selection of second dropdown will not show for the submitted form fields in my email. HOW DO I FORCE THE SECOND DROPDOWN SELECTION WHICH IS BEING POPULATED BY A JAVASCRIPT INTO DATABASE AND EMAIL LEAD? PLEASE HELP! Appreciate any input to help me resolve this item. code below

please review following code: (this is a smaller test version of my code that works, just the model doesn't feed into my lead capture details. actual page is here www.protectmyvehicle.net/indexA.html) thank you

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
function dynamicdropdown(listindex)
{
switch (listindex)
{
case "Acura" :
document.getElementById("status").options[0]=new Option("Select Model","");
document.getElementById("status").options[1]=new Option("1.6EL","1.6EL");
document.getElementById("status").options[2]=new Option("2.2CL","2.2CL");
break;
case "Audi" :
document.getElementById("status").options[0]=new Option("Select Model","");
document.getElementById("status").options[1]=new Option("100","100");
document.getElementById("status").options[2]=new Option("100CS","100CS");
document.getElementById("status").options[3]=new Option("100S","100S");
break;
}
return true;
}
</script>
</head>

<body>

<form name="contactForm" id="contactForm" method="post" action="http://www.mycontactform.com/sendform/sendform.php" style="width: 100%; border: 1px solid #005c97; margin: 0; padding: 0; background-color: #FFFFFF;">
<input name="user" type="hidden" id="user" value="protectmyvehicle" />
<input name="formid" type="hidden" id="formid" value="450659" />
<input name="subject" type="hidden" id="subject" value="ProtectMyVehicle.net Saves You Thousands on Your Extended Auto Warranty" />


<div class="category_div" id="category_div">Your Vehicle Make:
<select id="q11" name="q11" onchange="javascript: dynamicdropdown(this.options[this.selectedIndex].value);">
<option value="Select">Select Make</option>
<option value="Acura">Acura</option><option value="Audi">Audi</option><option value="BMW">BMW</option><option value="Buick">Buick</option><option value="Cadillac">Cadillac</option><option value="Chevrolet">Chevrolet</option><option value="Chrysler">Chrysler</option><option value="Dodge">Dodge</option><option value="FIAT">FIAT</option><option value="Ford">Ford</option><option value="GMC">GMC</option><option value="General Motors">General Motors</option><option value="Honda">Honda</option><option value="Hyandai">Hyandai</option><option value="Infiniti">Infiniti</option><option value="Isuzu">Isuzu</option><option value="Jaguar">Jaguar</option><option value="Jeep">Jeep</option><option value="KIA">KIA</option><option value="Lexus">Lexus</option><option value="Lincoln">Lincoln</option><option value="MINI">MINI</option><option value="Mazda">Mazda</option><option value="Mercedez-Benz">Mercedez-Benz</option><option value="Mercury">Mercury</option><option value="Mitsubishi">Mitsubishi</option><option value="Nissan">Nissan</option><option value="Oldsmobile">Oldsmobile</option><option value="Plymouth">Plymouth</option><option value="Pontiac">Pontiac</option><option value="Porsche">Porsche</option><option value="RAM">RAM</option><option value="Saab">Saab</option><option value="Saturn">Saturn</option><option value="Scion">Scion</option><option value="Suburu">Suburu</option><option value="Suzuki">Suzuki</option><option value="Toyota">Toyota</option><option value="Volkswagon">Volkswagon</option><option value="Volvo">Volvo</option><option value="Smart">Smart</option>
</select>
</div>
<div class="sub_category_div" id="sub_category_div">Your Vehicle Model:
<script type="text/javascript" language="JavaScript">
document.write('<select name="status" id="status"><option value="">Select Model</option></select>')
</script>
<noscript>
<select id="q14" name="q14">
<option value="Acura">Select Model</option>
<option value="1.6EL">1.6EL</option>
</select>
</noscript>
</div>
<tr style="margin: 0; padding: 0;">
<td style="background-color: #FFFFFF; border-bottom: 0px solid #eeeeee; padding: 5px; clear: left; margin: 0;">
<label for="email" style="float: left; width: 100%; display: block; padding-top: 4px; font-family: Arial; color: #000000; font-size: 14px;">E-MAIL ADDRESS: <span style="color: #FF0000">*</span></label>
<input name="email" type="email" id="email" size="20" maxlength="100" required="required" style="font-family: Arial; font-size: 14px; color: #000000; background-color: #FFFFFF; border: 1px solid #cccccc; padding: 2px;" />
</td>
</tr>

<input name="submit" type="submit" value="SUBMIT FOR YOUR FREE QUOTE TODAY" style="font-family: Arial; font-size: 16px; color: #ffffff; background-color: #005c97; border: 3px solid #005c97; padding: 2px;" />
</form>
</body>
</html>
Back to top
View user's profile
mycontac
Site Admin


Joined: 31 Dec 2003
Posts: 2750

PostPosted: Wed Dec 19, 2018 6:31 am    Post subject: Reply with quote

This line:

document.write('<select name="status" id="status">

is changing the name of the form element. It needs to match the name that we've provided (q14) I believe.

Nick Ladd
myContactForm.com
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    myContactForm.com - Help Forum Forum Index -> Form Management All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group