mark110384 Posted June 23, 2008 Share Posted June 23, 2008 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> Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/ Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 First of all, I always use " " on HTML attributes. Secondly, I know it's not -really- necessary (but it should be) to use the XML-valid tags...<input />, <br />, etc. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572135 Share on other sites More sharing options...
mark110384 Posted June 23, 2008 Author Share Posted June 23, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572202 Share on other sites More sharing options...
thebadbad Posted June 23, 2008 Share Posted June 23, 2008 Avoid using the short PHP open tag. Don't know if that's causing the problem, but still. And I totally agree with DarkWater. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572242 Share on other sites More sharing options...
mark110384 Posted June 23, 2008 Author Share Posted June 23, 2008 Nope thats not what causing the problem I originally developed that table in PHP but I then tried it HTML but to no avail. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572271 Share on other sites More sharing options...
dannyb785 Posted June 23, 2008 Share Posted June 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572286 Share on other sites More sharing options...
TheFilmGod Posted June 23, 2008 Share Posted June 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572610 Share on other sites More sharing options...
blueman378 Posted June 24, 2008 Share Posted June 24, 2008 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> Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572751 Share on other sites More sharing options...
blueman378 Posted June 24, 2008 Share Posted June 24, 2008 oh yeah, you dont need javascript to use a image as a form submit, the reason that firefox is displaying it is because firefix is intuitive and realizes it is eant to be closed so displays it asif it were closed Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572755 Share on other sites More sharing options...
dannyb785 Posted June 24, 2008 Share Posted June 24, 2008 Terrible advise. Using javascript would only be a band aid solution. 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. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-572886 Share on other sites More sharing options...
mark110384 Posted June 24, 2008 Author Share Posted June 24, 2008 Thanks blueman378 that sorted it out no end, dumbass error on my part not close the td open tags, wonder why it worked in FireFox though? Anyway thanks to everyones imput. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573035 Share on other sites More sharing options...
blueman378 Posted June 24, 2008 Share Posted June 24, 2008 no problem, but the reason it works in firefox is because its a better browser, by this i mean its intuitive, it sees the new tags and realizes they left this open accidentially and renders the codument asif it had been closed Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573166 Share on other sites More sharing options...
dannyb785 Posted June 24, 2008 Share Posted June 24, 2008 and renders the codument asif it had been closed but how does it know where to end the tag? Like what if he wanted the cell to display 'style="whatever"', it would probably interpret that as still being in the tag, right? Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573435 Share on other sites More sharing options...
blueman378 Posted June 25, 2008 Share Posted June 25, 2008 i believe it looks for a < because you obviously wouldnt have that inside a tag would you? Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573721 Share on other sites More sharing options...
haku Posted June 25, 2008 Share Posted June 25, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573798 Share on other sites More sharing options...
dannyb785 Posted June 25, 2008 Share Posted June 25, 2008 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 > Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573815 Share on other sites More sharing options...
haku Posted June 25, 2008 Share Posted June 25, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573822 Share on other sites More sharing options...
blueman378 Posted June 25, 2008 Share Posted June 25, 2008 thanks haku thats exactly what i meant, although i should point out im only guessing, and it proborably employs other techniques as well this is jsut one that i can see would be obvious Quote Link to comment https://forums.phpfreaks.com/topic/111472-solved-problem-with-displaying-a-button/#findComment-573870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.