www.webdeveloper.com
Results 1 to 2 of 2

Thread: Disable Input After Submit

  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Unhappy Disable Input After Submit

    What I'm making is like a slow chat to communicate with faraway friends .
    I want to disable only an input with the id "name" after the user submits a form. I also want to store the input in a cookie for later. (So if the user logs in again the input is disabled with the "name" in it.)

    I was stuck at the disabling. The problem is that every time the user clicks on submit, the page refreshes and the disable switched off. Isn't there a simple way to fix this?

    So far, the Javascript is:
    Code:
    function disable(){
    document.getElementById('name').disabled=true;
    }
    And then the submit button runs the script.

  2. #2
    Join Date
    May 2011
    Posts
    194

    maybe this

    Hi,


    if input "name" inside of FORM
    if input set to disabled then maybe onchange fires when the contents of the object or selection have changed.

    FORM have onchange see http://msdn.microsoft.com/en-us/library/ms535249.aspx
    http://msdn.microsoft.com/en-us/library/ms536912.aspx

    INPUT type=submit too

    but no default handler for onchange.

    document have recalc() Recalculates all dynamic properties in the current document
    http://msdn.microsoft.com/en-us/library/ms536685.aspx

    but no refresh()

    I think: Something outside of FORM and script calls refresh of document.

    f.e. document.write() after end of parsing of body

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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