Accessing Textfield value within same JSP

Hi All,

Can we access the value that will be entered in a text field, in the same JSP to enable/disable further fields(of the same form/JSP)?

For instance I've a jsp which has 3 fields. Depending on the value entered in the firstfield, I need to enable the third field(till then it has to be disabled)...


If yes, please let me know an example....


Thanks,
Karthik

Comments

  • : Hi All,
    :
    : Can we access the value that will be entered in a text field, in the
    : same JSP to enable/disable further fields(of the same form/JSP)?
    :
    : For instance I've a jsp which has 3 fields. Depending on the value
    : entered in the firstfield, I need to enable the third field(till
    : then it has to be disabled)...
    :
    :
    : If yes, please let me know an example....
    :
    :
    : Thanks,
    : Karthik
    :
    You should use a script that executes in the browser to handle this type of validation. E.g., in javascript...
    if( document.firstfield.value == 'John' )
    {
    document.thirdfield.disabled = true;
    }
  • : : Hi All,
    : :
    : : Can we access the value that will be entered in a text field, in the
    : : same JSP to enable/disable further fields(of the same form/JSP)?
    : :
    : : For instance I've a jsp which has 3 fields. Depending on the value
    : : entered in the firstfield, I need to enable the third field(till
    : : then it has to be disabled)...
    : :
    : :
    : : If yes, please let me know an example....
    : :
    : :
    : : Thanks,
    : : Karthik
    : :
    : You should use a script that executes in the browser to handle this
    : type of validation. E.g., in javascript...
    : if( document.firstfield.value == 'John' )
    : {
    : document.thirdfield.disabled = true;
    : }

    Thanks....
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories