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 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb pressing[activating] a button with a text field

    Does anyone has an idea how to
    activate the button every time I type something in the textfield. [onkeyup,down,etc]


    What this button does is that when it's pressed it passes any value i give it to
    the textarea.


    <form name="inputForm">

    <input type="text" size="10" >

    <input type="button" value="button" onClick="JavaScript:document.inputForm['test1'].value+='MY TEXT';">

    <textarea name="test1"></textarea></form>

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something like this? But it's not working... and I don't know why...

    Code:
    <html>
    
    <head>
    <script>
    function chkButton() {
    if (document.inputForm['txtBox'].value = "")
    {
    document.inputForm['thebutton'].disabled = true
    }
    else
    {
    document.inputForm['thebutton'].disabled = false
    }
    }
    </script>
    </head>
    
    <body>
    <form name="inputForm">
    
    <input name= "txtBox" onChange="chkButton()" 
    type="text" size="10" >
    
    <input name="thebutton" type="button" value="OK" 
    onClick="javascript:document.inputForm['test1'].value+=document.inputForm['txtBox'].value;">
    
    <textarea name="test1"></textarea>
    
    </form>
    </body>
    </html>
    [/code]

  • #3
    New Coder
    Join Date
    Dec 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    close, but actually I want to run whatever onclick function the button has
    everytime I type any word in the input box.


    In this next link sample that I give there are some input boxes on top of the DrawTable button and some other boxes in the bottom. the values for those boxes come from different javascripts but when I press the DrawTable button,
    i get the result in the parent frame from all the input boxes combined.




    This is the link of a prototype of my purpose


  •  

    Posting Permissions

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