PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

2 form objects on same page

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

  • 2 form objects on same page

    I added the search field to the top of my pages with this code

    Code:
    <form method="get" action="search/search.php">
    <input type="text" name="zoom_query" size="20" />
    <input type="submit" value="Search" />
    </form>
    but I already had a form object on the bottom of my page (a jump menu)

    Code:
    <form name="form" id="form">
    		    <select name="jumpMenu" id="jumpMenu" onChange="MM_jumpMenu('parent',this,0)">
                  <option value="#" selected="selected">Episode List</option>
                  <option value="episode001.php">Episode 01</option>
                  <option value="episode002.php">Episode 02</option>
                  <option value="episode003.php">Episode 03</option>
                  <option value="episode004.php">Episode 04</option>
                </select>
              </form>
    after adding the search field to the top of the page the form at the bottom stopped working. Just so you know I have no Idea about code as I created all my pages with dreamweaver so please talk to me as a complete novice

    Please explain how to add the search field without breaking the form object on the bottom. Thanks in advance.

  • #2
    You can't have a <form> ...</form> block within another <form> ... </form> block.

    So if possible, you should make sure the second form block at the bottom of the page is entirely enclosed at the bottom of the page. Is the opening form tag for that block located earlier at the top of the page (before the search form)? (just presuming that from the indentation of your copy+paste and your description).

    If the two forms are not within each other, they will not be conflicting. One of them however will have the default keyboard response (e.g. when you press "Enter" on the keyboard, it will submit one of the forms only). Other than that, hard to say without knowing exactly what the MM_jumpMenu() JavaScript is assuming.

    If none of the above helps, there is a last resort, and that is you can change the search form to not use a <form> ... </form> tag at all, and rely on JS, just as your menu does. This is described here. But again, this should not be necessary unless your two forms are really conflicting.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Just done a quick search of the source code and no the second form tags are at the bottom of the page (not right at the bottom but they are not opened at the top of the page and are closed like the code i gave). Judging from what you have said they should not be conflicting at all which is vexxing because they are conflicting.

      I think it may have something to do with they way i added the search field. I did it using dreamweaver templates which may have caused some kind of issue.

      Comment


      • #4
        I seem to have got it working....

        not sure what went wrong at all now.

        Comment


        • #5
          Glad it's working now. Always check the final HTML when something don't turn out right with Dreamweaver. Unfortunately, there's just no perfect web authoring program.
          --Ray
          Wrensoft Web Software
          Sydney, Australia
          Zoom Search Engine

          Comment

          Working...
          X