brent123456 Posted November 8, 2007 Share Posted November 8, 2007 <button type="submit" id="search" name="submitsearch" value="Search"> #search { background: transparent url(../site_images/search.gif) no-repeat top left; height: 20px; width: 60px; margin: 0 0 2px 5px;; padding: 0; border: 0; text-indent: -1000em; display:block cursor: pointer; /* hand-shaped cursor */ cursor: hand; /* for IE 5.x */ } This completely ruins my layout in IE7. It looks fine in FF. Does anyone know of what could be the problem or if there is a hack I have to do not to mess my layout up in IE? I know that it is the problem when I take it out everything goes back to normal. Thanks ??? Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/ Share on other sites More sharing options...
sKunKbad Posted November 9, 2007 Share Posted November 9, 2007 where is your semi-colon after display:block ? Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-388058 Share on other sites More sharing options...
brent123456 Posted November 10, 2007 Author Share Posted November 10, 2007 Thanks, I saw that. That wasn't the problem though . Anyone else have an idea? Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-388697 Share on other sites More sharing options...
TheFilmGod Posted November 10, 2007 Share Posted November 10, 2007 why this? <button type="submit" id="search" name="submitsearch" value="Search"> Use this instead: <input type="submit" id="search" name="submitsearch" value="Search" /> Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-388747 Share on other sites More sharing options...
brent123456 Posted November 11, 2007 Author Share Posted November 11, 2007 When I use <input type="submit" it puts borders around the submit button. Even when I use border:0;. It also puts writing over the image even when I use text-indent:-1000em; I am trying to use a submit image instead of a button. Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-388860 Share on other sites More sharing options...
AndyB Posted November 11, 2007 Share Posted November 11, 2007 <input type="image" .... http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html is a useful read. Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-388866 Share on other sites More sharing options...
brent123456 Posted November 11, 2007 Author Share Posted November 11, 2007 Thank Andy, I tried to use the input type="image" For some reason again in ie6 and ie7 with I click the button the form data is not passed to the form. function generate_searchtopform (){ // make the search bar at the top of the page $formsearch = false; $formsearch .= '<form action="' . $_SERVER['PHP_SELF'] . '?do=search" method="POST">'; $formsearch .= '<input type="text" name="strain" />'; $formsearch .= '<input type="image" src="../site_images/search.gif" class="search" name="submitsearch" alt="Search Seeds">'; $formsearch .= '</form>'; return $formsearch; } I might have to move this one to php. Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-389413 Share on other sites More sharing options...
AndyB Posted November 11, 2007 Share Posted November 11, 2007 Thank Andy, I tried to use the input type="image" For some reason again in ie6 and ie7 with I click the button the form data is not passed to the form. Well, we'd need to see the actual form processing script to help with that. Best guess is that your form processing script is looking for $_POST['submitsearch'] and processing if it's set. Wrong! With an image submit, clicking it passes the x and y co-ordinates of the clicked location relative to the upper-left corner of the image. $_POST['submitsearch_x'] and $_POST['submitsearch_y'] will be the values. IE does it right and FF does that bit wrong Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-389432 Share on other sites More sharing options...
brent123456 Posted November 12, 2007 Author Share Posted November 12, 2007 That was exactly right. So when I submit the form I would do a if ($_POST['submitsearch_x'] && $_POST['submitsearch_y']) { process $_POST['searchdata'] here? or would it be $_POST['searchdata_x'] && $_POST['searchdata_y'] } if it is $_POST['searchdata_x'] and $_POST['searchdata_y'] what would be contained in the values of each of these? Say is the textbox was say name="searchdata". Thank you. Brent Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-389903 Share on other sites More sharing options...
AndyB Posted November 12, 2007 Share Posted November 12, 2007 It's only image submits that return the x and y coordinates. And the value returned by each is the x or y coordinate of WHERE in the image it was clicked. if isset($_POST['submitsearch_x']) would be a rational test. Other fields contain their responses in $_POST['fieldname'] variables, so it would be process $_POST['searchdata'] in the example you cite. Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-390009 Share on other sites More sharing options...
brent123456 Posted November 13, 2007 Author Share Posted November 13, 2007 This worked perfect thanks Andy. I am having trouble trying to line up the text box and the image submit button. Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/76547-trouble-with-button-type-in-ie7/#findComment-390761 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.