1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Conflicting Forms??????????

Discussion in 'Web Design & Development' started by redivivus, Aug 2, 2006.

Thread Status:
Not open for further replies.
  1. redivivus

    redivivus Thread Starter

    Joined:
    Mar 30, 2006
    Messages:
    1,458
    I am very confused now!

    I have 2 forms that run on this one page... one is hidden at all times.

    Lets call them form1 and form2.

    When i use form2, it performs perfectly. However, if i then switch over to form1 and click submit, it acts as though the function (which always returns a false value) is not run, and it tries to go on (or refresh page if no target).

    After the page refreshes i can use form1 and it works perfectly. If i then switch to form2, form2 works fine without having to refresh!

    Both forms work fine alone, and the js has no errors in it. The page validates, and i see no errors in the code (though i could miss them :().

    Form1 comes first in the page, and then form2. As i stated, one is always set as hidden, and this is toggled. Form2 is the form that is visible when the page loads. If i switch to form1 before using form2, form1 works perfectly.

    Is there some program with my design? Some reason the forms conflict? :confused:

    Edit - I also tried switching the order of the forms in the html, and i get the exact same error. I toggled the visibility too, and same error once again. This seems to indicate that there is a problem in the html, but there is none. :confused:
     
  2. covert215

    covert215 Banned

    Joined:
    Apr 22, 2006
    Messages:
    2,595
    Please provide a sample of this. Your post is very confusing.

    Post the html.
     
  3. redivivus

    redivivus Thread Starter

    Joined:
    Mar 30, 2006
    Messages:
    1,458
    HTML:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <script language="javascript" type="text/javascript" src="scripts.js"></script>
    </head>
    <body onLoad="document.ch1llform.upper.checked=true;">
    <table>
     <tr>
      <td>
       <img name="sw" alt="blah" src="sw2.gif" onMouseDown="DivToggle('swdiv','on');DivToggle('csdiv','off');document.sw.src='sw2.gif';document.cs.src='cs1.gif';">
       <img name="cs" alt="blah" src="cs1.gif" onMouseDown="DivToggle('csdiv','on');DivToggle('swdiv','off');document.cs.src='cs2.gif';document.sw.src='sw1.gif';">
      </td>
     </tr>
    </table>
    <div id="swdiv" style="position:absolute;visibility:hidden;">
    <br><br>
    <form name="r4dform" method="POST" target="234" action="234" onSubmit="return spellwreck()">
    <input type="radio" name="begrad" onClick="document.r4dform.mode.value='corrmist'"/>Invoke common spelling mistakes.<br>
    <input type="radio" name="begrad" onClick="document.r4dform.mode.value='firstlast'"/>Randomly screw the inner letters of each word.<br>
    <textarea name="r4d" COLS=40 ROWS=6></textarea><br>
    <input type="hidden" name="mode" value=""/>
    <input type="text" name="percent" size="2"><br>
    <input type="checkbox" name="upper2" onClick="document.r4dform.lower2.checked=false">Convert to upper case.<br>
    <input type="checkbox" name="lower2" onClick="document.r4dform.upper2.checked=false">Convert to lower case.<br>
    <input type="submit" value="SW Seed."/>
    </form>
    </div>
    
    <div id="csdiv" style="position:absolute;visibility:visible;">
    <br><br>
    
       <img name="button" alt="blah" src="button1.gif" onMouseDown="applyTag(document.getElementById('ch1ll'))" onMouseUp="document.button.src='button1.gif'">
       
       <form name="ch1llform" method="POST" target="123" action="123" onSubmit="return coloredit()">
       <textarea name="ch1ll" COLS=40 ROWS=6></textarea><br>
       <input type="checkbox" name="upper" onClick="document.ch1llform.lower.checked=false"/>Add colors.<br>
       <input type="checkbox" name="lower" onClick="document.ch1llform.upper.checked=false"/>Remove colors.<br>
       <input type="submit" value="CS Seed."/>
       </form>
    
    </div>
    
    <br><br><span id="blah" style="postion:relative;"></span>
    </body>
    </html>
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/488687

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice