Jump to content

Trouble with Button Type in IE7


brent123456

Recommended Posts

<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 ???

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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.