www.webdeveloper.com
Results 1 to 6 of 6

Thread: "IE blows" or "Object doesn't suppor this property or method"

  1. #1
    Join Date
    Dec 2005
    Posts
    203

    "IE blows" or "Object doesn't suppor this property or method"

    In typical IE fashion the error offers little to no help. The code isn't complex, perhaps one of you JS guru's can help me fix it up (this is actually php script, so don't mind the \" and $'s. All this is supposed to do is swap the buttons when the checkbox is checked. Works fine in every browser I have installed except IE which tosses up the ever so helpful title error. Thanks for looking.

    HTML:
    Code:
    <tr bgcolor=$rowcolor>
    <td align=center colspan=6>
    <input type=checkbox name='complete' onClick=\"show_button();\"> Complete Report and Send for Final Sign Off
    </td>
    </tr>
    <tr bgcolor=$rowcolor id='complete_button' style=\"display:none\">
    <td align=center colspan=6>
    <input type=submit name='sub_state' value='Complete Report'>
    </td>
    </tr>
    <tr bgcolor=$rowcolor id='preview_button'>
    <td align=center colspan=6>
    <input type=submit name='sub_state' value='Preview Report'>
    </td>
    </tr>
    Javascript:

    Code:
    function show_button()
    {
    if(document.report_form.complete.checked==true)
    {
    document.report_form.getElementById('preview_button').style.display="none";
    document.report_form.getElementById('complete_button').style.display="";
    }
    else
    {
    document.report_form.getElementById('preview_button').style.display="";
    document.report_form.getElementById('complete_button').style.display="none";
    }
    }

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Instead of having two submit buttons and try to toggle display mode, use one submit button, default the value to "Preview", and set the logic in the function to alter the value to "Complete" if the checkbox is checked. The two submits are identical except for value.

    document.report_form.sub_state.value == "Preview/Complete";

    ^_^

  3. #3
    Join Date
    Dec 2005
    Posts
    203
    Cool thanks, I'll give that a whirl.

  4. #4
    Join Date
    Dec 2005
    Posts
    2,984
    No comment on the problem, but the love the Rocky and Bullwinkle throwback title. Awesome.
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...
    awesome.

  5. #5
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Quote Originally Posted by WolfShade View Post
    document.report_form.sub_state.value == "Preview/Complete";
    Sorry.. this should have only ONE "=", not two.
    Code:
    document.report_form.sub_state.value = "Preview/Complete";

  6. #6
    Join Date
    Dec 2005
    Posts
    203
    Funny I was just coming back here to say your solution worked like a charm, with the noted exception you just posted. I'm not used to looking at JS so it took me a minute to track down the issue. Thanks again for the solution, and kudos to the other R&B fan.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles