Web Analytics Made Easy -
StatCounter window.open clearing form.... - CodingForum

Announcement

Collapse
No announcement yet.

window.open clearing form....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • window.open clearing form....

    I have a page with a form on it and a button that opens a new window for them to verify the data. What happens is that when the window opens, the form gets cleared out. This is with FireFox (IE has issues too!) Now this code has actually work fine for several years, now all of a sudden it's an issue. Possibly browser update issues? Here's a VERY stripped down version that shows the problem:

    Code:
    <HTML>
    <HEAD>
    <TITLE>Test</TITLE>
    
    <script language="JavaScript" type="text/javascript">
    
    function Proc_Reg(frm)
    {
       window.open("","","status=1,menubar=1,resizable=1,scrollbars=1,width=900,height=800");
    }
    </script>
    </HEAD>
    
    <BODY>
    test
    <form name=RegForm >
    
    <TABLE>
    <TR><TD><font color = "RED">PLEASE MAKE SURE YOUR BROWSER'S SECURITY SETTINGS ALLOW SCRIPTS TO RUN.</font></TD></TR></TABLE>
    <BR><BR>
    <font size=7>BCU Festival Registration</font><BR><center>Event Date: September 11, 2011</center>
    <HR>
    <table>
    <tbody>
    <tr><td><FONT FACE="BRITANNIC BOLD" size=4>
    Name:</font></td><td>
    <input title="What is Your Name?" name="FullName" rows="1" size="45" type="text">
    </td></tr>
    </tbody></table>
    
    </form>
    
    <A HREF="" OnClick="javascript:Proc_Reg(RegForm);">Click</A>
    
    </BODY>
    </HTML>
    Ideas???

  • #2
    If you don't suppress the natural action of any <a> link, then it *will* go ahead and load a new page, using the href, when clicked on.

    Answer is easy:
    Code:
    <a href="#" onclick="Proc_Reg(RegForm);[B][COLOR="Red"] return false;[/COLOR][/B]">Click</a>
    And isn't it time you moved to xhtml and all lower case tag names and properties?
    Be yourself. No one else is as qualified.

    Comment


    • #3
      Originally posted by Old Pedant View Post
      If you don't suppress the natural action of any <a> link, then it *will* go ahead and load a new page, using the href, when clicked on.

      Answer is easy:
      Code:
      <a href="#" onclick="Proc_Reg(RegForm);[B][COLOR="Red"] return false;[/COLOR][/B]">Click</a>
      Finally got around to trying this. Your fix works great. Thanks

      Originally posted by Old Pedant View Post
      And isn't it time you moved to xhtml and all lower case tag names and properties?
      yeah....probably, you know...old dogs and all that...
      Thanks again

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎