SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    form wont post on ie7

    posted this in general dev issues, but it might be a php issue.
    I have a multipage php search form that I use a session to pass variables to the next page. I use an "action" page to collect all the posts and save to the session before loading the page to avoid repost requests. When i get to the last page of the search request form, i have it post to the action page, load a php script to create the query and pass it to the session and then load the search results page which loads the query from the session. On this last page of the form, when I click on the submit button in IE7 only, it doesn't post or anything. It works fine in MF2 or IE6, but not in IE7! What am I doing wrong or is there a bug? link provided to first page of search form. --> whipple1.whippleauction.com/search

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Don't do a check for a button (if (isset($_POST['submitbutton'])) { Instead do a check for a required element or what I do is use a hidden form element which is always sent.

    IE doesn't send buttons that you don't click on.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    If there will be only one reason something is being posted from that last page simply check for a form submission. Then validate as normal:

    PHP Code:
    if (isset($_POST) && is_array($_POST) && count($_POST))
    {
        
    // do stuff


  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When i click on the submit button on ie7, nothing happens, it just sits there. All the other pages, the submit button works fine and even tell you what page the form posts to when you roll over it. So I'm thinking the issue isn't php because it doesn't take any action on a click.

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Post your code
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code HTML4Strict:
    <form action="searchaction.php" method="post">
     
    <label>Price Range:</label> <input type="text" name="price_low" size=10> to <input type="text" name="price_hi" size=10><br/>
    <label>Bedrooms:</label> <input type="text" name="bed_low" size=5> to <input type="text" name="bed_hi" size=5><br/>
    <label>Bathrooms:</label> <input type="text" name="bath_low" size=5> to <input type="text" name="bath_hi" size=5><br/>
    <label>Garage Spaces:</label> <input type="text" name="grg_low" size=5> to <input type="text" name="grg_hi" size=5><br/>
     
    <label>Style:</label> <SELECT name="style">
    <option></option>
    <OPTION>1 1/2 Stor</OPTION>
    <OPTION>1 Story</OPTION>
    <OPTION>2 1/2 Stor</OPTION>
    <OPTION>2 Story</OPTION>
    <OPTION>4 Level Sp</OPTION>
    <OPTION>Bi-Level</OPTION>
    <OPTION>Other</OPTION>
     
    <OPTION>Raised Ran</OPTION>
    </SELECT></br>
    <label>Basement:</label> <SELECT name="bsmnt">
    <OPTION></OPTION>
    <OPTION>Common</OPTION>
    <OPTION>Full</OPTION>
    <OPTION>Full,Walk-Out</OPTION>
    <OPTION>Other</OPTION>
    <OPTION>Partial</OPTION>
     
    <OPTION>Slab</OPTION>
    </SELECT><br/>
    <label>Acres:</label> <input type="text" name="acre_low" size=5> to <input type="text" name="acre_hi"size=5><br/>
    <label>Square Footage:</label> <input type="text" name="sqft_low" size=8> to <input type="text" name="sqft_hi" size=8><br/>
    <label>Order by:</label> <SELECT name="order">
    <OPTION></OPTION>
     
    <OPTION>ListingPrice</OPTION>
    <OPTION>Acres</OPTION>
    <OPTION>SquareFootage</OPTION>
    <OPTION>Bedrooms</OPTION>
    <OPTION>Bathrooms</OPTION>
    </SELECT><br/>
    <input id='submit' type="submit" value="Search" name='detailsaction'/></form>

  7. #7
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    There is something else going on that code is not to blame. Works fine for me. FF and IE7.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  8. #8
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm so glad you guys are taking the time to help me. the link again is whipple1.whippleauction.com/search

    the code for the action page is

    PHP Code:
    <?php
    print_r
    ($_POST);
    session_start();
    if(isset(
    $_POST['marketaction']))
    {
      
    $table $_POST['type'];
      
    $_SESSION['table'] = $table;
      
    header("Location: searchcounty.php");

    }
    elseif(isset(
    $_POST['countyaction']))
    {
      
    $county $_POST['county'];
      
    $_SESSION['county'] = $county;

      
    header("Location: searcharea.php");

    }
    elseif(isset(
    $_POST['areaaction']))
    {
      
    $area1 $_POST['area1'];
      
    $area2 $_POST['area2'];
      
    $area3 $_POST['area3'];

      
    $_SESSION['area1'] = $area1;
      
    $_SESSION['area2'] = $area2;
      
    $_SESSION['area3'] = $area3;
      
    header("Location: searchdetails.php");

    }
    elseif(isset(
    $_POST['detailsaction']))
    {
      
    $price_hi $_POST['price_hi'];
      
    $price_low $_POST['price_low'];
      
    $bed_low $_POST['bed_low'];
      
    $bed_hi $_POST['bed_hi'];
      
    $bath_low $_POST['bath_low'];
      
    $bath_hi $_POST['bath_hi'];
      
    $park_low $_POST['park_low'];
      
    $park_hi $_POST['park_hi'];
      
    $grg_hi $_POST['grg_hi'];
      
    $grg_low $_POST['grg_low'];
      
    $sqft_low $_POST['sqft_low'];
      
    $sqft_hi $_POST['sqft_hi'];
      
    $style $_POST['style'];
      
    $basement $_POST['bsmnt'];
      
    $order $_POST['order'];
      
    $_SESSION['price_hi'] = $price_hi;
      
    $_SESSION['price_low'] = $price_low;
      
    $_SESSION['bed_low'] = $bed_low;
      
    $_SESSION['bed_hi'] = $bed_hi;
      
    $_SESSION['bath_low'] = $bath_low;
      
    $_SESSION['bath_hi'] = $bath_hi;
      
    $_SESSION['park_low'] = $park_low;
      
    $_SESSION['park_hi'] = $park_hi;
      
    $_SESSION['grg_hi'] = $grg_hi;
      
    $_SESSION['grg_low'] = $grg_low;
      
    $_SESSION['sqft_low'] = $sqft_low;
      
    $_SESSION['sqft_hi'] = $sqft_hi;
      
    $_SESSION['style'] = $style;
      
    $_SESSION['bsmnt'] = $bsmnt;
      
    $_SESSION['order'] = $order;
      
    header("Location: searchresults.php");

    }
    ?>
    but it never gets to that action page, only on the last page, just freezes out, only on IE7. if you have a second, try to make a search and see what happens. maybe its getting covered by a div or something? is there a firebug for ie?

  9. #9
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You cannot check for "detailsaction". Try instead checking if($_POST) or like suggested for a required element. Or you might try a hidden element on the HTML side and then a check for its value in the php code the form is submitted to.

    What do you mean by "just freezes out"? The page hangs? The submit button does nothing?

    Is downloading Firefox and plugging in Firebug an option to see if there is something weird happening in your HTML code.

  10. #10
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "just freezes out" = the submit button does absolutely nothing, not even click. Firefox looks fine as far as the html code.
    Why can I not check for "detailsaction"(name of the button), when it works fine for the rest of the pages of this form? I will change this anyways, but it seems to work fine now.

  11. #11
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do other forms with the same method of checking work in IE7? There's got to be some difference, can you show us the HTML and PHP from other forms?

    The fact that our failure occurs before any php code runs means this is not a PHP problem and there's nothing inherently wrong with your HTML as far as I can tell. I'm leaning towards a browser bug.

    Show us some working code from other forms; there's got to be some reason.

  12. #12
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so ya, i pretty much just wasted your time cuz i found out there was a div i use to push the footer down covering it up. sorry!!!!

  13. #13
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe it seemed like a waste of time then, but just now it was the same problem I was having so you helped me


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •