Hi,

I am fairly new at this and was hoping to get some help on this problem:

I have a couple of forms on the same page: 1) a dropdown with 2 selections using the "POST" method followed by 2) a search form.

When I run the html, the dropdown works fine - when a selection is made the target URL is called and the POST method can be referenced in the target php code.

However, when I execute a search in the second form, the target URL for the search is NOT called - instead the dropdown URL is called. I tried to reduce the problem to the least amount of sample code, which is:

<form  method='POST' name='cat_form' action='e107_plugins/ytm_gallery/ytm.php'>
<select class='tbox' name='cat' onchange=cat_form.submit()>
<option value='1' >Home Movies</option>
<option value='2' >Other Videos</option>
</form> 

<form action='http://tngnetwork.lythgoes.net/gdxsearch.php' method='POST' name='gdx' target='_blank'>
<input class='tbox' type='text' name='surname' size='20' maxlength='100' />
<input type='submit' value=Search >
</form>

Thanks in advance for any pointers

Dennis

    4 days later

    I don't see any problem off-hand with your code, other than maybe the target attribute on the second form tag. I've never used target with <form>. Try taking that out, maybe, but other than that, I don't see anything out of the ordinary with it.

      Well, you can be a little pickier: some of the attribute values aren't quoted, the form is inconsistent about closing empty elements (sometimes <input /> sometimes just <input>) but, most importantly, the <select> element in the first form is missing its closing tag.

        Weedpacket wrote:

        Well, you can be a little pickier: some of the attribute values aren't quoted, the form is inconsistent about closing empty elements (sometimes <input /> sometimes just <input>) but, most importantly, the <select> element in the first form is missing its closing tag.

        ... correct you are, good sir. 🙂

          This seems to work fine for me...i just changed single quotes to double quotes (which probably did nothing at all) and changed that one /> to > and closed the <select> tag:

          <form method="POST" name="cat_form" action="e107_plugins/ytm_gallery/ytm.php">
           <select class="tbox" name="cat" onchange=cat_form.submit()>
            <option value="1" >Home Movies</option>
            <option value="2" >Other Videos</option>
           </select>
          </form>
          
          <form action="http://tngnetwork.lythgoes.net/gdxsearch.php" method="POST" name="gdx" target="_blank">
           <input class="tbox" type="text" name="surname" size="20" maxlength="100">
           <input type="submit" value=Search >
          </form>
          
            Write a Reply...