SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2008
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PhP won't work in IE6

    Hey I'm creating a site that allows you to dynamically go through select lists by going through categories of alcohol. For instance when a user clicks on rum a list of Rum containing Bacardi Rum and Captain Morgan, etc. is shown in a new slect lists. The user can then click on this specific alcohol which adds it to a text area. They then can click submit which does some database queriesb which are kinda supposed to be secret so But on IE6 the submit button won't do anything and I'm wondering if thats a common issue. It's a pretty basic thing it just has a text area with method post and a php script for the action. Here's the code IE6 can do all of the dynamic forms fine it just won't submit them to the next page.

    <div class="c"><table class="n"><tr><th class="n">
    <select id="list1" size="11" style="width:190px" >
    <option value="Beer">Beer</option>
    <option value="Bourbon">Bourbon</option>
    <option value="Brandy">Brandy</option>
    <option value="Gin">Gin</option>
    <option value="Liqueur">Liqueur</option>
    <option value="Rum">Rum</option>
    <option value="Scotch">Scotch</option>
    <option value="Tequila">Tequila</option>
    <option value="Vodka">Vodka</option>
    <option value="Whiskey">Whiskey</option>
    <option value="Wine">Wine</option>
    </select></th><th class="n">
    <button onclick="remove();add2list('list1','list2');"> --> </button><br/>
    <th class="n"><select id="list2" size="20" style="width:190px">
    <option></option></select> <button onclick="addlist('list2','list3');"> --> </button> <form id="submit" action="returnAlcohol.php" method="POST"><textarea id="list3" name="message" rows="5" cols="45"></textarea>
    </select><button>SUBMIT</button></th></tr></form><br/>

    </tr>
    </div>

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is html, not php code.

    Please use [code] or [php] tags when posting.

  3. #3
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shouldn't you be using an <input> button to submit your form?

  4. #4
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Itch View Post
    Shouldn't you be using an <input> button to submit your form?
    No. Button is a valid element, although it should have a type attribute with a value of submit.

  5. #5
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I do not know how it works in any other browser, the select element is not even in the form! Anyways what is the PHP code the form submits to?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  6. #6
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by decowski View Post
    No. Button is a valid element, although it should have a type attribute with a value of submit.
    The <button> element is broken in IE6 as it sends something like the innerHTML of the DOMElement. Please replace this with an <input type=submit> and let us know how it goes, assuming this isn't an issue with scripts.
    Cross browser css bugs

    Dan Schulz you will be missed

  7. #7
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    The <button> element is broken in IE6
    No, it's not.

    Quote Originally Posted by SoulScratch View Post
    as it sends something like the innerHTML of the DOMElement.
    How exactly is it broken? Speculating is not helping anyone here, sorry mate. If you have a point to make then make it, otherwise you're confusing all of us.

    EDIT: OK, I tested. Fair enough, it's broken in the way that it sends whatever it surrounds minus tags instead of sending its value attribute. But it doesn't make it unusable. Then Firefox's implementation is broken too, because it acts as a submit button even if no type parameter is specified. So you were somewhat right in one part but you should have explained what you meant. As logic_earth explains below, checking submit button's value is not a reliable way of checking if the form has been submitted, anyway. Hopefully those quirks will go away one day...

  8. #8
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    The problem with most new comers to PHP and forms, they always check if the submit button as been submitted. Instead one should check for a required field as been submitted.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  9. #9
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by decowski View Post
    it's broken in the way that it sends whatever it surrounds minus tags instead of sending its value attribute.
    That is what I meant when I said innerHTML. I was specifically stating how it was broken, so I'm not sure what other explanation I needed.

    Quote Originally Posted by decowski View Post
    But it doesn't make it unusable.
    If you've ever built an overly large e-commerce site and tried <button>s, it's simply not "usable" in IE6 because of the fact that it sends innerHTML.
    Cross browser css bugs

    Dan Schulz you will be missed

  10. #10
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    you've ever built an overly large e-commerce site and tried <button>s, it's simply not "usable" in IE6 because of the fact that it sends innerHTML.
    Actually it is very usable. It is not that hard to workaround the problem.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  11. #11
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    That is what I meant when I said innerHTML. I was specifically stating how it was broken, so I'm not sure what other explanation I needed.
    as it sends something like the innerHTML of the DOMElement.
    Far from specifically. But maybe it's just me.

    Quote Originally Posted by SoulScratch View Post
    If you've ever built an overly large e-commerce site and tried <button>s, it's simply not "usable" in IE6 because of the fact that it sends innerHTML.
    If I'd ever built anything overly large, then I should have had been in another job. Sorry, you're not giving any arguments.

    I have built just-enough-large e-commerce platforms and used submit buttons and it greatly improved user experience due to their "richer rendering possibilities" as the spec nicely puts it.

  12. #12
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    Actually it is very usable. It is not that hard to workaround the problem.
    It's still extra work if you're dealing with stylized buttons which is why I avoid them in general, and the work arounds I can think of would be:

    a) Relying solely on the innerHTML text value and not putting any extra content around it, though this isn't a good option
    b) Possibly relying on the name attribute value?
    c) If there's *one* button element and it's a simple form then rely on another form field value and/or hidden input
    d) Iterate through all the button elements and replace them with input elements dynamically using JS ( if the buttons contain img elements then type=image ).
    e) Iterate through all the button elements and replace them with <a>nchors that either have an <img> child or are styled with bg images and set the href to the form action value + GET parameter that's the same as the value attribute
    f) Not use it at all?
    Cross browser css bugs

    Dan Schulz you will be missed

  13. #13
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by decowski View Post
    Far from specifically.
    Agh, shouldn't have thrown the "something like" in there as I did type out exactly what it was but it's been awhile since someone has brought this up.
    Cross browser css bugs

    Dan Schulz you will be missed

  14. #14
    SitePoint Enthusiast
    Join Date
    Feb 2008
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks using an input tag worked

  15. #15
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by decowski View Post
    Far from specifically. But maybe it's just me.



    If I'd ever built anything overly large, then I should have had been in another job. Sorry, you're not giving any arguments.

    I have built just-enough-large e-commerce platforms and used submit buttons and it greatly improved user experience due to their "richer rendering possibilities" as the spec nicely puts it.
    what is your problem?


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
  •