Solved

IE7 & javascript not playing nice.  Javascript does not recognize form

Posted on 2007-12-03
7
515 Views
Last Modified: 2013-12-24
I have a field in my form that the user is to enter a number.  When the user changes the value, I calculate how much the order will cost and give an alert box with the amount.  I use Frontpage to help build sites quickly and then enter extra code as necessary, such as this.  In the Preview it works.  In IE7, it doesn't.  It seems as if IE7 is keeping the javascript from recognizing the form and its values.  I am getting an error stating that the 'FOMM_form' is undefined.  The form works and like I said, it is only crapping out in IE7.  Here is the code:


<html>

 

<head>

<title>Friends of Mountain Mahogany</title>

<meta name="Microsoft Theme" content="designed-by-m 011, default">

<SCRIPT language="JavaScript">

<!--

function calc(value)

{

value = FOMM_form.Farolitos_requested.value*2.5;

alert("The total amount for this order is $" + value);

}

// -->

</SCRIPT>

</head>

 

<body>

 

<form method="POST" action="--WEBBOT-SELF--" name="FOMM_form">

	<!--webbot bot="SaveResults" S-Email-Format="HTML/UL" S-Email-Address="fakeemail@domain.zzz" B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="FALSE" S-Email-Subject="order from FOMM Form" S-Builtin-Fields="HTTP_USER_AGENT Date Time" S-Date-Format="%A, %B %d, %Y" S-Time-Format="%I:%M:%S %p" -->

	<h2 align="center">Friends of Mountain Mahogany (FOMM) Community School</h2>

	<h3 align="center">1st Annual Farolito Sale</h3>

	<p align="center">Thank you for helping us to help our beloved school.&nbsp; 

	Please fill out the information below.&nbsp; We will draw our production 

	needs based on the results from this form.&nbsp; If you have any questions 

	or problems, please feel free to

	<a href="mailto:fakeemail@domain.zzz?subject=FOMM Form">contact us</a>.</p>

	<p>Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="4" -->

	<input type="text" name="name" size="40" tabindex="1"></p>

	<p>

	<input type="radio" value="do_have_a_child" checked name="community_member" tabindex="2">&nbsp; 

	I do have a child(ren) at MMCS.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<input type="radio" name="community_member" value="do_no_have_a_child" tabindex="3">&nbsp; 

	I do NOT have a child(ren) at MMCS</p>

	<p>Phone Number:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<!--webbot bot="Validation" s-data-type="String" b-allow-digits="TRUE" s-allow-other-chars="(xxx) xxx-xxxx" b-value-required="TRUE" i-minimum-length="14" i-maximum-length="14" -->

	<input type="text" name="phone" size="14" value="(505) " tabindex="4" maxlength="14"></p>

	<p>Number of Farolitos to purchase:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<!--webbot bot="Validation" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="3" s-validation-constraint="Greater than" s-validation-value="1" -->

	<input type="text" name="Farolitos_requested" size="3" tabindex="5" maxlength="3" onchange="calc(value)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>

	<p>Have you placed a previous order?&nbsp; </p>

	<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<input type="radio" name="New_order" value="No" checked tabindex="6">No.<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<input type="radio" name="New_order" value="Yes_change_order" tabindex="7">Yes, 

	and I am requesting a change to my order.<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<input type="radio" name="New_order" value="yes_add_to_order" tabindex="8">Yes, 

	and I am requesting to add to my order.</p>

	<p>Pick Up Time requested:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

	<!--webbot bot="Validation" s-display-name="Time_Requested" b-value-required="TRUE" b-disallow-first-item="TRUE" -->

	<select size="1" name="Time_requested" tabindex="9">

	<option selected>Select a time</option>

	<option>10:00 am</option>

	<option>10:30 am</option>

	<option>11:00 am</option>

	<option>11:30 am</option>

	<option>12:00 pm</option>

	<option>12:30 pm</option>

	<option>1:00 pm</option>

	<option>1:30 pm</option>

	<option>2:00 pm</option>

	<option>2:30 pm</option>

	<option>3:00 pm</option>

	</select></p>

	<p>&nbsp;</p>

	<p align="center">

	<input type="submit" value="Submit" name="B1" tabindex="10"><input type="reset" value="Reset" name="B2" tabindex="11"></p>

</form>

 

</body>

 

</html>

Open in new window

0
Comment
Question by:prostang
  • 3
  • 2
7 Comments
 
LVL 3

Expert Comment

by:getmorepc
ID: 20399194
More people use IE6 or Firefox. Make sure permissions in the browser are right (java and js enabled) and the site is in the trusted zone.
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 20399235
>>> value = FOMM_form.Farolitos_requested.value*2.5;


Try this instead:

value = document.FOMM_form.Farolitos_requested.value*2.5;
0
 

Author Comment

by:prostang
ID: 20400414
b0lsc0tt,
Thank you for the removal.  It was an ovesight on my part

routinet,
Your answer led me to the solution being:
value = document.FrontPage_Form1.Farolitos_requested.value*2.5
I tried your suggestion and it didn't work, but as I started typing the document. part, it entered the Frontpage_Form1 part.  It doesn't make sense to me, but it is working now.

Thanks again.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 50

Accepted Solution

by:
Steve Bink earned 250 total points
ID: 20401071
That's the name of the form.  I used your naming convention in my post.  This is from live version:

<form [ ..snip.. ] name="FrontPage_Form1"

Glad to hear it is resolved.  Good luck!
0
 

Author Comment

by:prostang
ID: 20401215
I understand that it is the name of the form, but as you can see in my code snippet, that is not the name I gave it, and it is not the name that I posted on the web to test.  I just....changed?
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 20406942
Right, but it was the name on line 19 of your original question, which is where I got it from.  No matter...at least it was a simple fix, yes?  :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Popup to change image and store url in database 2 30
JS Plugin Chaining 2 32
Animated .jpg? 13 59
using php variable inside javascript 5 13
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now