close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Visible fields in a form dependent on current state of checkboxes

Thread began 2/20/2012 6:19 pm by iainmacdonald331081 | Last modified 2/22/2012 12:02 pm by Jason Byrnes | 1642 views | 8 replies |

iainmacdonald331081

Visible fields in a form dependent on current state of checkboxes

If that makes sense...

Will be looking at this tomorrow, but just wanted to ask if this sort of thing is possible using VT.

What I'd like (or rather what a client would like!) is a form where people can request a brochure to be sent in the post, or a brochure to be sent by email, or to be called back.

So there would be three checkboxes initially visible:

1. Request brochure (post)
2. Request brochure (email)
3. Request call back

If 1. is checked, the following fields would be revealed:

Name
Address

If 2. is checked, the following fields would be revealed:

Name
Email address

If 3. is checked, the following fields would be revealed:

Name
Phone number

Ignoring the fact that it may be a little overcomplicated, does it sound like the sort of thing achievable using validation show if?

Sign in to reply to this post

Jason ByrnesWebAssist

you could do this using the Show / Hide form element behavior included with client validation in validation toolkit.

use the required client validation type on the onblur event of the checkbox and the show hide form element validation response.

Sign in to reply to this post

iainmacdonald331081

Thanks Jason - I'll have a look at that for future reference.

With this one, I ended up using an accordion. I do have a glitch with the error message on the first form being visible all the time though.

accordion5.php

Sign in to reply to this post

iainmacdonald331081

All working here now:

accordion6.php

I just need to move the CAPTCHA error messages though, as the accordion panels are closed by default when the page reloads.

One thing I meant to ask though - with the CAPTCHA is it possible for the from not to lose everything the user has entered if they get the CAPTCHA code wrong?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, bind the initial values of the form elements to the corresponding option in the validated entries collection.

Sign in to reply to this post

iainmacdonald331081

Sorry Jason - how do I do that?

Sign in to reply to this post

Jason ByrnesWebAssist

select the form element in design view.

in the property inspector, click the lightning bolt next to initial value.

Expand the validated entries collection on the bindings panel , and select the binding with the same name for the form element.

Sign in to reply to this post

iainmacdonald331081

Thanks Jason.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

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

Content

rating

Layout

rating

Ease of use

rating

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...