Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-21-2011, 03:19 AM   PM User | #1
tc2606
New to the CF scene

 
Join Date: Jul 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
tc2606 is an unknown quantity at this point
Javascript not working correctly on firefox

Hey guys,

My code works perfectly fine in internet explorer and google chrome, however, in firefox it does not. I have created an online form, but nothing happens when pressing the "submit" button firefox, whereas in other browsers, it works correctly. Also, the centering of the form is different.

Please help me if possible. Thanks


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Airduct Cleaning</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link href="text.css" rel="stylesheet" type="text/css">

<script type="text/JavaScript">
function gosubmit(){

musimw.submit();

}
</script>
<style type="text/css">
#text { width: 250px; position: relative; margin-left: 200px; }
</style>
</head>
<body leftmargin="0" topmargin="0">
<table width="998" heigt="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="147" valign="top">
<!----LEFT MENU--------->
<? include "left_menu.php"; ?>
</td>
<td width="591" valign="top" colspan="1">
<!----TOP--------->
<? include "top.php"; ?>

<!----TITLE--------->
<table width="100%" heigt="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="590" height="33" background="images/top_bg2.gif" valign="bottom"><img src="images/title_sub09_01.gif" /></td>
<td width="1" bgcolor="#d3dfe6"></td>
</tr>
</table>
<!----CONTENT--------->
<!----story------>
<form action=sendmail2.php method=post name=musimw enctype=multipart/form-data onSubmit="return musimm_check(this);">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr style=" position: relative; margin-left: 28px;">
<td width="50"></td>
<td><p><span class="stxt2">Call for a Free Estimate</span><br>
<br>
<img src="images/img25.gif" align="left"><strong>For a free estimate, call:
</strong></p>
<div id="text">
Office: Insert Office #<br />
Toll-Free: Insert Toll Free # <br />
Email: Insert Email<br />
<br><em>Or, submit the online form below.</em>
</div>
</td>
</tr>
<tr>
<td width="50"></td>
<td>
<table width="530" align="center" border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF">
<tr>
<td width="10"></td>
<td width="180" height="25">*First name</td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='fname'/></td>
</tr>
<tr>
<td width="10"></td>
<td width="180" height="25">*Last name</td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='lname'/></td>
</tr>
<tr>
<td></td>
<td >Phone Number<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='ptel'/> <select name='pteltype'>
<option value='Home'>Home</option>
<option value='Work'>Work</option>
</select></td>
</tr>
<tr>
<td></td>
<td >Cell Phone Number<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='ctel'/></td>
</select></td>
</tr>
<tr>
<td></td>
<td height="25">*Email Address</td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='email'/></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
<tr>
<td width="10"></td>
<td width="180" height="25">*Type of Service</td>
<td style="padding:10px 5px 5px 5px"><select name='bnametype'>
<option value='Air Duct Cleaning'>Air Duct Cleaning</option>
<option value='Dryer Vent Cleaning'>Dryer Vent Cleaning</option>
<option value='Chimney Cleaning'>Chimney Cleaning</option>
</select></td>
</tr>
<tr>
<td></td>
<td height="25">Square Footage<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='feet'/></td>
</tr>
<tr>
<td></td>
<td height="25">Approximate # of Ducts<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20"name='vent' /></td>
</tr>
<tr>
<td></td>
<td height="25">Number of furnaces</td>
<td style="padding:10px 5px 5px 5px"><select name='furnaces'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select></td>
</tr>
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
<tr>
<td></td>
<td valign="top" style="padding-top:5px">*Address</td>
<td style="padding:10px 5px 5px 5px"><input type="text" class="inputPlain004" size="30" name='address'></td>
<tr>
<td></td>
<td height="25">*City<br /></td>
<td style="padding:10px 5px 5px 5px"><input name="city" type="text" class="inputPlain004" value="" size="12"></td>
</tr>
<tr>
<td></td>
<td height="25">*State </td>
<td style="padding:10px 5px 5px 5px"><select name='statetype'>
<option value='State'>IL</option></td>
</tr>
<tr>
<td></td>
<td height="25">*Zip Code</td>
<td style="padding:10px 5px 5px 5px"><input name="zip" type="text" class="inputPlain004" value="" size="12"></td>
</tr>
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
<tr>
<td></td>
<td valign="top" style="padding-top:5px">Comments or Questions</td>
<td style="padding:10px 5px 5px 5px"><textarea name='Comment' cols="45" rows="8"></textarea></td>
</tr>
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
</table>
<!---BUTTON--->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50" align="center"><a href="javascript:gosubmit()"><img src="images/bt_submit.gif"></a>&nbsp; <a href="#"><img src="images/bt_cancel.gif"></a></td>
</tr>
</table>
</form>
</td>
<td width="1" bgcolor="#d3dfe6"></td>
</tr>
</table>
</td>
<td width="260" valign="top">
<!----RIGHT-------->
<? include "right_menu.php"; ?>
</td>
</tr>
</table>
<!------BOTTOM---------->
<? include "foot.php"; ?>

</body>
</html>

Last edited by tc2606; 07-21-2011 at 04:46 AM..
tc2606 is offline   Reply With Quote
Old 07-21-2011, 03:52 AM   PM User | #2
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
Do you really expect us to ask you for a problem to solve.

If you want help you have to post your code.
Nobody here wants to steal your code, and the solution to your problem, could help others with similar problems.
Lerura is offline   Reply With Quote
Old 07-21-2011, 04:43 AM   PM User | #3
tc2606
New to the CF scene

 
Join Date: Jul 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
tc2606 is an unknown quantity at this point
Quote:
Originally Posted by lerura View Post
Do you really expect us to ask you for a problem to solve.

If you want help you have to post your code.
Nobody here wants to steal your code, and the solution to your problem, could help others with similar problems.
You're right. I'll edit my post with it in a minute.
tc2606 is offline   Reply With Quote
Old 07-21-2011, 07:38 AM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,992 Times in 3,961 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
You are doing
Code:
    musimw.submit();
and apparently you think that the name musimw is some global.

Yes, it is, in MSIE.

But not in standard JavaScript.

You must use "scope" to find it. To wit:
Code:
    document.musimw.submit();
or
Code:
    document.forms["musimw"].submit();
or even
Code:
    document.forms[0].submit();
However...

You declared your page to be xhtml1-transitional.dtd, and in xhtml, <form> names are deprecated. So, technically, you should change to using
Code:
<form id="musimw" ...>
and then do
Code:
    document.getElementById("musimw").submit();
though the code
Code:
    document.forms[0].submit();
is correct so long as you know that the <form> in question is the only (or at least first) form on the page.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
tc2606 (07-21-2011)
Old 07-21-2011, 08:04 AM   PM User | #5
low tech
Regular Coder

 
low tech's Avatar
 
Join Date: Dec 2009
Posts: 740
Thanks: 149
Thanked 67 Times in 67 Posts
low tech is on a distinguished road
Hi

This might move you forward.

I've cleaned up missing quotes spelling etc and changed the submit function

BUT I removed onSubmit="return musimm_check(this);" You can add it back when you include your validation.


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Airduct Cleaning</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link href="text.css" rel="stylesheet" type="text/css">

<script type="text/JavaScript">
function gosubmit(){

document.getElementById("musimw").submit();

} 
</script>
<style type="text/css">
#text { width: 250px; position: relative; margin-left: 200px; }
</style>
</head>
<body leftmargin="0" topmargin="0">
<table width="998" heigt="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="147" valign="top">
<!----LEFT MENU--------->
<? include "left_menu.php"; ?>
</td>
<td width="591" valign="top" colspan="1">
<!----TOP--------->
<? include "top.php"; ?>

<!----TITLE--------->
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="590" height="33" background="images/top_bg2.gif" valign="bottom"><img src="images/title_sub09_01.gif" /></td>
<td width="1" bgcolor="#d3dfe6"></td>
</tr>
</table>
<!----CONTENT--------->
<!----story------> 
<form action="sendmail2.php" method="post" name="musimw" id="musimw" enctype="multipart/form-data" > 

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr style=" position: relative; margin-left: 28px;">
<td width="50"></td>
<td><p><span class="stxt2">Call for a Free Estimate</span><br> 
<br>
<img src="images/img25.gif" align="left"><strong>For a free estimate, call:
</strong></p>
<div id="text">
Office: Insert Office #<br />
Toll-Free: Insert Toll Free # <br />
Email: Insert Email<br />
<br><em>Or, submit the online form below.</em>
</div>
</td> 
</tr>
<tr>
<td width="50"></td>
<td>
<table width="530" align="center" border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF">
<tr>
<td width="10"></td>
<td width="180" height="25">*First name</td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name="fname" /></td>
</tr>
<tr>
<td width="10"></td>
<td width="180" height="25">*Last name</td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name="lname" /></td>
</tr> 
<tr>
<td></td>
<td >Phone Number<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name="ptel" />
<select name="pteltype">
<option value="Home">Home</option>
<option value="Work">Work</option>
</select></td>
</tr>
<tr>
<td></td>
<td >Cell Phone Number<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name="ctel" /></td>
</select></td>
</tr>
<tr>
<td></td>
<td height="25">*Email Address</td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name="email" /></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
<tr>
<td width="10"></td>
<td width="180" height="25">*Type of Service</td>
<td style="padding:10px 5px 5px 5px"><select name="bnametype">
<option value="Air Duct Cleaning">Air Duct Cleaning</option>
<option value="Dryer Vent Cleaning">Dryer Vent Cleaning</option>
<option value="Chimney Cleaning">Chimney Cleaning</option>
</select></td>
</tr> 
<tr>
<td></td>
<td height="25">Square Footage<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20" name="feet" /></td>
</tr>
<tr>
<td></td>
<td height="25">Approximate # of Ducts<br /></td>
<td style="padding:10px 5px 5px 5px"><input type="text" size="20"name="vent" /></td>
</tr>
<tr>
<td></td>
<td height="25">Number of furnaces</td>
<td style="padding:10px 5px 5px 5px"><select name="furnaces">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select></td>
</tr>
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
<tr>
<td></td>
<td valign="top" style="padding-top:5px">*Address</td>
<td style="padding:10px 5px 5px 5px"><input type="text" class="inputPlain004" size="30" name="address"></td>
<tr>
<td></td>
<td height="25">*City<br /></td>
<td style="padding:10px 5px 5px 5px"><input name="city" type="text" class="inputPlain004" value="" size="12"></td>
</tr>
<tr>
<td></td>
<td height="25">*State </td>
<td style="padding:10px 5px 5px 5px"><select name="statetype">
<option value="State">IL</option></td>
</tr>
<tr>
<td></td>
<td height="25">*Zip Code</td> 
<td style="padding:10px 5px 5px 5px"><input name="zip" type="text" class="inputPlain004" value="" size="12"></td> 
</tr> 
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
<tr>
<td></td>
<td valign="top" style="padding-top:5px">Comments or Questions</td>
<td style="padding:10px 5px 5px 5px"><textarea name="Comment" cols="45" rows="8"></textarea></td>
</tr>
<tr>
<td colspan="3"height="1" background="images/point.gif"></td>
</tr>
</table>
<!---BUTTON--->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50" align="center"><a href="javascript: gosubmit()"><img src="images/bt_submit.gif"></a>&nbsp;<a href="#undefined"><img src="images/bt_cancel.gif"></a></td>
</tr>
</table>
</form> 
</td>
<td width="1" bgcolor="#d3dfe6"></td>
</tr>
</table>
</td>
<td width="260" valign="top">
<!----RIGHT-------->
<? include "right_menu.php"; ?>
</td>
</tr>
</table>
<!------BOTTOM---------->
<? include "foot.php"; ?>

</body>
</html>
LT

Last edited by low tech; 07-21-2011 at 08:10 AM..
low tech is offline   Reply With Quote
Users who have thanked low tech for this post:
tc2606 (07-21-2011)
Old 07-21-2011, 08:51 AM   PM User | #6
tc2606
New to the CF scene

 
Join Date: Jul 2011
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
tc2606 is an unknown quantity at this point
Guys, thank you very very much for your help. The submit works now. The form is a little off center, but I can work on that myself, you guys have helped me a lot.. The main issue is fixed. Thanks
tc2606 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:32 AM.


Advertisement
Log in to turn off these ads.