Results 1 to 8 of 8

Thread: Making Add fields visible/invisible

  1. #1
    Join Date
    Feb 2003
    Posts
    62

    Making Add fields visible/invisible

    Is it possible to make an invisible text box used for adding text to a record appear? What I want to do is select a specific value from a SelectBox and then make an invisible text box appear if the value is (say) Other which would require more information. Is there a way of doing this?

  2. #2
    Join Date
    Oct 2002
    Posts
    933
    Note that upon the click of the submit button - the values are submitted to the URL and you can intercept that before Tornado does. The url has a lot of info in it like submit values, last click button, unit etc... so the answer is that you can certainly do that.

    Frank

  3. #3
    Join Date
    Feb 2003
    Posts
    62
    Yes but can you do it when the dropdown list value is selected?Otherwise wouldn't you have to submit the page before the text box appeared?

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    this is client side validation. If the built-in's (RE, standard MASKs)are not enough to validate then you have to write javascript or Java to perform additional tasks.

    FK

  5. #5
    Join Date
    Feb 2003
    Posts
    62
    Frank - any chance of a coding sample to show how this fits into a page?

  6. #6
    Join Date
    Oct 2002
    Posts
    933
    I'll look around and do not find anything close as the local super validation does not even support the dropdowns (only textbox, textarea and password). If you use dbValidatename then you take over the OnSubmit and all the internal client side validation will not be effective. Everybody is fighting for the javascript submit and also the OnLoad event.

    Actually it seems very complex becasue aftr you have to control to the dsiplay of the invisible box, you have to control the hiding of it.



    FK

  7. #7
    Join Date
    Oct 2002
    Posts
    93
    Hi Bob,

    I had an example laying around that shows what you're after. I uploaded it to our examples site. Go to:

    http://aspdbtest.com/test/js-show-hide-fields.asp

    To check it out. I think it's what you're after. You'll have to take care of making part of the ASP-db validation routine, etc. I assume you're using Enterprise or Gold where you can do this all with a template right?

    Good luck,
    John

  8. #8
    Join Date
    Feb 2003
    Posts
    62
    John

    This looks exactly what I am looking for! I am on Enterprise and I will be trying it out soon.

    Thanks
    Bob

Posting Permissions

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