Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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 05:46 AM.

  • #2
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    947
    Thanks
    0
    Thanked 130 Times in 129 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,603
    Thanks
    80
    Thanked 4,633 Times in 4,595 Posts
    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.

  • Users who have thanked Old Pedant for this post:

    tc2606 (07-21-2011)

  • #5
    Regular Coder low tech's Avatar
    Join Date
    Dec 2009
    Posts
    891
    Thanks
    174
    Thanked 102 Times in 102 Posts
    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 09:10 AM.

  • Users who have thanked low tech for this post:

    tc2606 (07-21-2011)

  • #6
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •