23 users online (0 members and 23 guests)  

Thread: disabling


  Results 1 to 5 of 5

Related

  1. disabling and then enabling a button    Forum: PHP Forum
    Replies: 3
  2. Disabling Image Dragging    Forum: HTML Forum
    Replies: 1
  3. Replies: 4
  1. #1
    Comms's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2004
    Posts
    3

    disabling

    hi, i new to these forums so i hope i'm in the right place

    i am wanting to know how to disable a button once it has been click, now i have the perfect script for the task however once the button is clicked and disabled, the form isn't submitted!!

    heres the code

    PHP Code:
    <?

    // ISBN CHECKING SCRIPT

    if (isset($_POST['submit'])) {
        
        
    // PROCESS NUMBER
        
    }

    else {
        
        
    // SHOW FORM
        
        
    print '<form name="isbn" method="POST" action="'.$PHP_SELF.'">';
        print 
    'ISBN : <input type="text" name="isbnnum" maxlength="10"><br><br>';
        print 
    '<input type="submit" name="submit" value="Check ISBN" onClick="document.isbn.submit.disabled = true"></form>';
        
    }

    ?>
    can anyone advise me on how to sort this problem?

    thanks, Comms

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi,

    Do you mean the PHP does not detect that the form has been disabled (not surprising, as the input is disabled) or do you mean the form does not post itself at all in the first place? if the latter, try amending to
    Code:
    document.isbn.submit.disabled = true;this.form.submit()
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Comms's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2004
    Posts
    3
    when i use that and i click the button an error is generated (error appears in the status bar)

    when i view the error it says "object doesnt support this property or method"

    any suggestions?

    thanks, Comms

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    my fault for not testing it with your code.

    Do you mean the PHP does not detect that the form has been disabled (not surprising, as the input is disabled) or do you mean the form does not post itself at all in the first place?
    Could you also post a link to your page if possible, I would like to see it live.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    Comms's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2004
    Posts
    3
    http://www.theutherfish.com/isbn.php



Tags for this Thread