close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

validate dropmenu to show a different textfield

Thread began 8/26/2009 4:08 pm by un33k9309513 | Last modified 9/08/2009 4:04 pm by un33k9309513 | 3994 views | 11 replies

Eric Mittman

Getting the client side validations in place to show and hide divs on a page can be a little tricky if it is not something you have done before.

I have an example page that I created that has the type of validation on it that I think you are asking about. I will post the page itself and list the steps that I took here to get it in place.

step 1:
make sure the form is in place include the divs around the two fields you would like to toggle. The divs must have unique ids for the areas they surround. You will also need to default the divs to be hidden by adding this inline style:


step 2:
in my example my select list has two choices, only one choice has a value, the other option has it's value set to "".

step 3:
select your select list in the form, then go to the tag > behaviors panel to apply the client validation. Choose the required/not blank validation. Make sure it is configured for the current select list.

step 4:
as a response to the required validation apply the show hide layer validation response. Make sure to select the first div as the target layer, and choose to hide this layer if trigger is valid.

step 5:
Now that you have your first validation/response combo you can add in the second. For this one you will add in another required validation for the select list, then your response validation will be another show hide layer. In this one you will select the second div as the target layer and choose to show this div is trigger is valid.

You should now have a form on the page and have two sets of validations applied to the select list. The first is to check if a value has been selected, if true then hide the first input, the next validation will check to see if the select list has a value and show the second input. Since these validations for show hide reverse themselves when the triggering validation fails you do not need to worry about the alternate states. Attached is an example page of this validation in place.

Attached Files

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...