• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

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

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
prostang
Asked:
prostang
  • 3
  • 2
1 Solution
 
getmorepcCommented:
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
 
Steve BinkCommented:
>>> value = FOMM_form.Farolitos_requested.value*2.5;


Try this instead:

value = document.FOMM_form.Farolitos_requested.value*2.5;
0
 
prostangAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Steve BinkCommented:
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
 
prostangAuthor Commented:
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
 
Steve BinkCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now