Jump to content

[SOLVED] Problem with displaying a button


mark110384

Recommended Posts

I now have a problem displaying an update buton in a table, again it works in Firefox but inIE it doesn't display the button at all below is the code, any suggestions would be welcome.

 

<table border = "0" cellpading = "0" cellspacing = "0" align = "center">

<tr>

<td width = "355"</td>

<td width = "160"><font face = arial size ="2" align = "left"> Have you made changes? </font></td>

 

<td width = "100" align = "center" <? echo "<input type='image' src='updatetrolley.bmp' border='0' alt='Add'> <input type='hidden' name='count' value='" . ($i-1) . "'>" ?>

</td>

</tr>

</table>

</form>

Link to comment
Share on other sites

if it works in FF but not in IE then its not a php problem, it's just one of those annoying things IE doesnt do that it should. You'll need to lookup a different way to display the button image. Like for example do an image tag and then include "onclick='this.form.submit()'" try that out.

Link to comment
Share on other sites

if it works in FF but not in IE then its not a php problem, it's just one of those annoying things IE doesnt do that it should. You'll need to lookup a different way to display the button image. Like for example do an image tag and then include "onclick='this.form.submit()'" try that out.

 

Terrible advise. Using javascript would only be a band aid solution.

 

Take out ALL PHP, only work with parsed php, - only the html. (Come on, that is advice from 101 html class).

 

Get rid of tables. What are you using tables for layout? And instead of using <input type="image" /> use <button type="submit" name="submit"></button>. It is styled and manipulated much easier.

Link to comment
Share on other sites

just thought id point out that you arnt closing your td open tags, thats whats causing the problems

 

try

 

   <table border = "0" cellpading = "0" cellspacing = "0" align = "center">
   <tr>
   <td width = "355"></td>
   <td width = "160"><font face = arial size ="2" align = "left"> Have you made changes? </font></td> 

   <td width = "100" align = "center"> <? echo "<input type='image' src='updatetrolley.bmp' border='0' alt='Add'> <input type='hidden' name='count' value='" . ($i-1) . "'>" ?>   
   </td>
   </tr>
   </table>
   </form>

Link to comment
Share on other sites

You can say that it's not what you would do, but if you're gonna call someone out and say they're flat out wrong, you need to have a good reason.

 

Using javascript is not a good solution, because it won't work if people have javascript turned off in their browser. Search engines also don't employ javascript, so any page that requires it won't be accessible. It's better to create a solution that works with javascript off, then if you want, you can add javascript over top in order to provide better functionality.

 

 

As for how browsers decide what to do with invalid code (which includes missing closing tags etc), well each browser figures out what to do in its own way. This is why invalid code usually produces discrepancies between browsers, and why valid code produces less discrepancies between browsers. If the code validates, then the browsers don't have to make guesses as to how they should display it.

 

Link to comment
Share on other sites

i believe it looks for a < because you obviously wouldnt have that inside a tag would you?

 

 

Your response doesn't make any sense. A tag starts with a < and if there is no > to end it, how can a browser know when to end it? Referring to a < doesn't apply since the entire question is when would a browser know where to insert the >

Link to comment
Share on other sites

His answer made sense, though I don't know if that is how browsers actually do it or not.

 

Since there isn't likely to be a '<' inside a tag, if it finds one, then it can guess that this is the first character of the opening tag of the next element, and so the last, unfinished element has probably ended.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.