Page 1 of 1

Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 1:59 pm
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??

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:08 pm
by aceconcepts
Not entirely sure from a glance but you haven't named either of your submit buttons.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:09 pm
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.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:19 pm
by aceconcepts
Fair enough. If that works for you, just a thought.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:20 pm
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.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:35 pm
by aceconcepts
Try removing the JavaScript from the submit buttons for now.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:38 pm
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.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:41 pm
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>......

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:43 pm
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.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:55 pm
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?

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 2:59 pm
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.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 3:11 pm
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.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 3:27 pm
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.

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 3:44 pm
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>
 

Re: Firefox ignore second Form Submit button

Posted: Tue Aug 11, 2009 3:48 pm
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.