Firefox ignore second Form Submit button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Firefox ignore second Form Submit button

Post by simonmlewis »

Code: Select all

<div class='admingalleryheader'><img src='images/txt_galleryphotos.gif' />
      <form action='index.php?page=myvehicleedit&menu=myvedit&edit my vehicle' method='POST' name='photo' enctype='multipart/form-data'>
            <input type='hidden' name='id' value='5'><input type='hidden' name='update' value='addphoto'>
            <input name='photo' type='file' /><input type='submit' value='&nbsp;' class='submituploadfile'></form>
      <table width='100%' cellpadding='4' cellspacing='0'><tr><td colspan='2'><hr noshade size='1' color='#ffffff'></<td></tr><tr bgcolor='#CE8B00'><td align='right'>
     <form method='post' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='5'>
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='54792050db9.jpeg'>
 
<input type='submit' value='&nbsp;' class='submitdeletegall'  onclick="javascript&#058;return confirm('Are you sure you want to delete this photo?');">
</form></td><td>
      <a href='images/productphotos/54792050db9.jpeg' rel='lightbox[5]' /><img src='images/productphotos/54792050db9.jpeg' style='border: 1px solid #000000' width='90px' /></a></td><tr>
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff'></<td></tr>
  
<tr bgcolor='#CE8B00'><td align='right'>
     <form method='post' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='5'>
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='15277987db9.jpeg'>
<input type='submit' value='&nbsp;' class='submitdeletegall'  onclick="javascript&#058;return confirm('Are you sure you want to delete this photo?');">
</form></td><td>
      <a href='images/productphotos/15277987db9.jpeg' rel='lightbox[5]' /><img src='images/productphotos/15277987db9.jpeg' style='border: 1px solid #000000' width='90px' /></a></td><tr>
 
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff'></<td></tr>
  
</table></div>
            </div>
 
Dear all

Here is the rendered code in the Firefox browser.
This code displays two images from the server, with a delete button by each image.

The first image and the delete submit button are both clickable.
The second image and delete button are not. The should be, and are displayed correctly, but the mouse is an arrow and does absolutely nothing in Firefox.

Anyone know why??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Firefox ignore second Form Submit button

Post by aceconcepts »

Not entirely sure from a glance but you haven't named either of your submit buttons.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

I didn't think you had to name the submit button, only the fields where data is passed, for the $variables to collect it?

In fact, I have never named submit buttons, yet they have always worked.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Firefox ignore second Form Submit button

Post by aceconcepts »

Fair enough. If that works for you, just a thought.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

That's the problem, it isn't.

I have tried it with a name, but same problem.

First field works, second set does not work.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Firefox ignore second Form Submit button

Post by aceconcepts »

Try removing the JavaScript from the submit buttons for now.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

Sorry, didn't make a difference.

That said, the <img> tag is just an opener of the file, and that has no javascript. The second of those won't work either.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

Here is the actual code:

Code: Select all

echo "<table width='100%' cellpadding='4' cellspacing='0'><tr><td colspan='2'><hr noshade size='1' color='#ffffff'></<td></tr>";
            
            $string = "$row->photos";
      $token = strtok($string,"|");
      while($token) {
      echo "<tr bgcolor='#CE8B00'><td align='right'>
      
     <form method='post' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='$row->id'>
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='$token'>
<input type='submit' name='deletephotograph' value='&nbsp;' class='submitdeletegall'>
</form>
 
</td><td>
      <a href='images/productphotos/$token' rel='lightbox[$row->id]' /><img src='images/productphotos/$token' style='border: 1px solid #000000' width='90px' /></a></td><tr>
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff'></<td></tr>
  
";
$token = strtok("|");
}
            
            echo "</table>......
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Firefox ignore second Form Submit button

Post by aceconcepts »

I think i've found the problem. You had some broken tags.

This is a precise copy of your code but without the syntax errors:

Code: Select all

 
<div class='admingalleryheader'><img src='images/txt_galleryphotos.gif' />
      <form action='index.php?page=myvehicleedit&menu=myvedit&edit my vehicle' method='POST' name='photo' enctype='multipart/form-data'>
            <input type='hidden' name='id' value='5'><input type='hidden' name='update' value='addphoto'>
            <input name='photo' type='file' /><input type='submit' value='&nbsp;' class='submituploadfile'></form>
      <table width='100%' cellpadding='4' cellspacing='0'><tr><td colspan='2'><hr noshade size='1' color='#ffffff'><td></tr><tr bgcolor='#CE8B00'><td align='right'>
     <form method='post' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='5'>
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='54792050db9.jpeg'>
 
<input type='submit' value='&nbsp;' class='submitdeletegall'  onclick="javascript&#058;return confirm('Are you sure you want to delete this photo?');">
</form></td><td>
      <a href='images/productphotos/54792050db9.jpeg' rel='lightbox[5]' /><img src='images/productphotos/54792050db9.jpeg' style='border: 1px solid #000000' width='90px' /></a></td><tr>
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff'><td></tr>
 
<tr bgcolor='#CE8B00'><td align='right'>
     <form method='post' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='5'>
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='15277987db9.jpeg'>
<input type='submit' value='&nbsp;' class='submitdeletegall'  onclick="javascript&#058;return confirm('Are you sure you want to delete this photo?');">
</form></td><td>
      <a href='images/productphotos/15277987db9.jpeg' rel='lightbox[5]' /><img src='images/productphotos/15277987db9.jpeg' style='border: 1px solid #000000' width='90px' /></a></td><tr>
 
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff'><td></tr>
 
</table></div>
            </div>
 
 
It should work now.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

Sorry, it didn't work.

I had to fix the return: in the javascript as for some reason it made it the longer version with the & sign.

What were the errors you found?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Firefox ignore second Form Submit button

Post by aceconcepts »

You had random half closing tags like </<td>

I'd suggest combing your code for errors like this. The fact that a form element doesn't respond usually has something to do with broken tags.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

All fixed but problem remains.

I have several errors in </td> and </tr>.

I also added a name field to the <form method...> tag.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

I have just cleared what was on there, and uploaded new photos yet it is still the SECOND row that is dead.

Second row being the submit button and the photo (to open the image through the <a> tag.

I just don't understand why FF would do this, whereas IE is fine.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

Ok, here's something to add to the puzzle.

If I had a THIRD photo to the database, the FIRST and THIRD are the only ones that can be clicked on - the middle one won't.

Here's the rendered code:

Code: Select all

<div class='admingalleryheader'><img src='images/txt_galleryphotos.gif' />
      <form action='index.php?page=myvehicleedit&menu=myvedit&edit my vehicle' method='POST' name='photo' enctype='multipart/form-data'>
            <input type='hidden' name='id' value='5'><input type='hidden' name='update' value='addphoto'>
            <input name='photo' type='file' /><input type='submit' value='&nbsp;' class='submituploadfile'></form>
      <table width='100%' cellpadding='4' cellspacing='0'>
            <tr><td colspan='2'><hr noshade size='1' color='#ffffff'></td></tr><tr bgcolor='#CE8B00'><td align='right'>
     <form method='post' name='photo' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='5'>
 
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='81387889wheel.JPG'>
<input type='submit' value='&nbsp;' class='submitdeletegall' onclick="javascript&#058;return confirm('Are you sure you want to delete this photo?');">
</form></td><td>
      <a href='images/productphotos/81387889wheel.JPG' rel='lightbox[5]' /><img src='images/productphotos/81387889wheel.JPG' style='border: 1px solid #000000' width='90px' /></a></td></tr>
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff' /></td></tr>
  
<tr bgcolor='#CE8B00'><td align='right'>
     <form method='post' name='photo' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='5'>
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='19433708dash.jpg'>
<input type='submit' value='&nbsp;' class='submitdeletegall' onclick="javascript&#058;return confirm('Are you sure you want to delete this photo?');">
</form></td><td>
 
      <a href='images/productphotos/19433708dash.jpg' rel='lightbox[5]' /><img src='images/productphotos/19433708dash.jpg' style='border: 1px solid #000000' width='90px' /></a></td></tr>
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff' /></td></tr>
  
<tr bgcolor='#CE8B00'><td align='right'>
     <form method='post' name='photo' action='index.php?page=myvehicleedit&menu=myvedit&title=edit my vehicle'>
<input type='hidden' name='id' value='5'>
<input type='hidden' name='update' value='deletephoto'>
<input type='hidden' name='photodelete' value='54792050db9.jpeg'>
<input type='submit' value='&nbsp;' class='submitdeletegall' onclick="javascript&#058;return confirm('Are you sure you want to delete this photo?');">
</form></td><td>
      <a href='images/productphotos/54792050db9.jpeg' rel='lightbox[5]' /><img src='images/productphotos/54792050db9.jpeg' style='border: 1px solid #000000' width='90px' /></a></td></tr>
      <tr><td colspan='2'><hr noshade size='1' color='#ffffff' /></td></tr>
 
  
</table></div>
            </div>
 
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Firefox ignore second Form Submit button

Post by simonmlewis »

Another update

I now have four pictures in the system, and it's the SECOND one that has the problems.

The first and final two are both ok.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply