Automate undisabled a “submit button”?

Discussion in 'Programming' started by Hercf, Apr 5, 2008.

  1. #1
    Help!
    Hi, everyone!
    I have this problem:
    There is a “textbox” and a “submit” button.
    “Submit button” is disabled until something is written within “text box”. I am not able to do this switch. Could anybody help me?
    Here you are the code:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <cfform name="form1" id="form1" method="post" action="">
    <cfinput type="text" name="Text" id="Text">
    <cfinput type="submit" name="submit" disabled="disabled" id="submit" value="Submit">
    </cfform>
    </body>
    </html>

    Thank you!
     
    Hercf, Apr 5, 2008 IP
  2. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Check out this link and see if it helps you...

    http://bytes.com/forum/thread152399.html

    Do you need this for validation?

    You really need some server side validation if you decied to use this peice of javascript...
     
    unitedlocalbands, Apr 6, 2008 IP
  3. Hercf

    Hercf Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank's again!
    There is no way to do it simple, in Coldfusion?
    H.
     
    Hercf, Apr 6, 2008 IP
  4. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #4
    I dont belive so.

    Coldfusion only runs when a page is requested from the server. So unless the person hits the submit button, no coldfusion code will run.

    Thats why you need javascript or anyother "client side" script to handel this type of function.

    CFML is strictly "server side"
     
    unitedlocalbands, Apr 6, 2008 IP