Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2004
    Location
    North Carolina
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question button disable until text entered

    I have one form that looks kinda like this:
    Code:
    <form name="Infant">
    <p>What method did Lewis and Brooks-Gunn use to test infants’ self-recognition?</p>
    <p><input name="Inf1" type="text" size="60" onFocus="enbutton()"></p>
    <p>What behavior indicates that infants recognize themselves (have a mental image of their own faces)?</p>
    <p><input name="Inf2" type="text" size="60"></p>
    &nbsp;
    <p><input type="button" name="check" value="Check Answers" onClick="winInf()"></p>
    </form>
    and another form that is within a table.
    I have disabled the "Check Answers" buttons for both forms from a java code with onload.

    But now I'm trying to re-enable the button for the current form when the user starts typing in one of the textboxes of that form... I've tried some code (as evidenced by the enbutton() function) but I keep running into errors, what should I be doing?

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You kinda forgot to include your script which shows how your are disabling the button. Without that. There is not much we can offer in the way of a solution.

    .....Willy

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts
    <p><input name="Inf1" type="text" size="60" onkeydown="this.form.check.disabled=(this.value!='')?false:true"></p>

  • #4
    New Coder
    Join Date
    Feb 2004
    Location
    North Carolina
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    solution

    Thanks for the help... I figured out how to re-enable the buttons directly within the forms after much more struggle.


  •  

    Posting Permissions

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