Results 1 to 5 of 5

Thread: disable button AFTER submit not sending other form field values?

  1. #1
    Join Date
    Jan 2009
    Posts
    82
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default disable button AFTER submit not sending other form field values?

    I can't get a form button to become disabled (greyed out) and still get the form to submit:

    <input name="btnsubmit" type="submit" id="btnsubmit" onclick="this.value='Please wait...';this.disabled = true;this.form.submit();" value="Submit"/>

    This changes the text, disables the button, but when the form submits all other form fields come in empty?

    This works and does the job, but I want to grey out the box or hide it
    <input name="btnsubmit" type="submit" id="btnsubmit" onclick="this.value='Please wait...';this.disabled = disabled;this.form.submit();" value="Submit"/>

  2. #2
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default

    ___________________________________

    Still working on it!

  3. #3
    Join Date
    Jan 2009
    Posts
    82
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    I'll test the other one out. Currently, I'm using this code, but it only works in Mozilla, not IE or safari.

    onClick="this.value='Please wait...';this.disabled = disabled;submitform();"


    <SCRIPT language="JavaScript">
    function submitform()
    {
    document.form1.submit();
    }
    </SCRIPT>

  4. #4
    Join Date
    Jan 2009
    Posts
    82
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    I get the same problem with that script, It's a dynamic page written coldfusion. The Form is disabling the button, but the form fields are not being submitted...

  5. #5
    Join Date
    Jan 2009
    Posts
    82
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    AHH. I realized what's happening. In my dynamic code I was checking if the form was submitted by the submit button using an IF statement which is what I always do.

    My lack of knowledge about javascript didn't tell me that the button values weren't being submitted after being disabled. Basically its just a vehicle to submit the form but its basically useless afterward.

    I used another form field to check if the form is being submitted and everything is smooth now.

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
  •