Forum Moderators: open

Message Too Old, No Replies

form not processing correctly issue

works in some browsers, not in others

         

Baruch Menachem

5:00 am on Mar 16, 2010 (gmt 0)

10+ Year Member



On my web page I have two little web forms with separate actions. For some reason in Opera and Chrome they don't work correctly, but they do in Safari.
<form action="shortopic.php" method="post">
<select name="thistopic">
<?php
$view="select * from Topics order by topic";
$result=mysql_query($view) or die("out of cheese error, redo from start".mysql_error());
while($row=mysql_fetch_array($result))
{
$topic=$row['topic'];
$topic_id=$row['topic_id'];
if ($topic_id==8)
$sel="Selected";
else $sel=" ";
$cat=<<<MEOW
<option value ="$topic_id" $sel>$topic</option>

MEOW;
echo $cat;


}
?>
</select>
<input type="submit" name="tsubmit" value=" Go! "
</form>
</li>
<li><a href="http://example.com/name.php" target="_blank">Sorted by Author's last name</a></li>
<li><a href="http://example.com/title.php" target="_blank">Sorted by title</a></li>
</ul>
<form action="seeker.php" method="post">
Or you can search here: <input type="text" name ="seek" length="35" maxlength="35" />
<input type="submit" name= "submit" value="seek wisdom">
</form>


When I click on the second form section, in opera and chrome it does the first form submit. Which is cool, if that what I want. But that isn't the case.

[edited by: incrediBILL at 5:58 am (utc) on Mar 16, 2010]
[edit reason] Only use EXAMPLE.COM for sample domain names [/edit]

kaled

11:35 am on Mar 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As a general rule, don't name submit buttons "submit". Browsers can become confused because of a name conflict with the form.submit() method.

Set the name attribute of each submit button to null and report back.

Kaled.

coopster

12:19 pm on Mar 16, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Your first input submit element is not closed. It is missing the end tag.

Baruch Menachem

3:10 pm on Mar 16, 2010 (gmt 0)

10+ Year Member



Thanks. I was sure I had validated this out the wazoo. The tag was missing, and now it is not, and now it works the way it is supposed to work.

Thanks for the help