<!--[if gte mso 9]>
Normal
0
oNotOptimizeForBrowser />
Many, many thanks David,
<!--[if !supportEmptyParas]--> <!--[endif]-->
I have done as you suggested and it’s working perfectly. However, I have stuck to the CheckBox (rather than your javascript approach) because I now want to convert it to an “Agree … terms and conditions?” question.
<!--[if !supportEmptyParas]--> <!--[endif]-->
And may I add, if there is anyone reading this who is not convinced of the quality of the product or high level of customer service that the team at Datasprings provides I want to give a huge endorsement for both. David, in particular, has spent a lot of time helping me and I am very grateful. Great effort.
<!--[if !supportEmptyParas]--> <!--[endif]-->
The following is a contribution that puts what I have learned back into the pool………
<!--[if !supportEmptyParas]--> <!--[endif]-->
If planning to hide the Submit button you have to decide when you want the question that will lead to its opening (eg clk(ShowHide) ) to become visible. Demonstration 7 gives an example where that controlling question (the ‘Do you agree to the Terms and Conditions”) is visible right from the form opening.
<!--[if !supportEmptyParas]--> <!--[endif]-->
On the other hand, you may not want that question to appear until a series of preliminary questions has been answered. That was my case, and the subject of Candace’s and David’s terrific assistance above. My logic for wanting to do this is up in my post of 21 July
<!--[if !supportEmptyParas]--> <!--[endif]-->
How to set up the first case is explained briefly on page 118 of the Feb 2009 (V3) User Guide. Here that explanation is expanded and the lessons from this post are added:
- Add a Simple CheckBox
- Give it any Question name (eg “Do you agree to …..?”
- Ensure you give it a Short Name of exactly chkShowHide. (Be careful: if you give the Question itself that name (in ‘da big box) and have it automatically copy to the Short Name it will truncate to a field length of 10. The following code won’t like it.)<!--[if !supportLists]-->
- In its Client side events (in Advanced Field Options) add<!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
if($(chkShowHide))
showhtml('SaveForm')
else
hidehtml('SaveForm')
<!--[if !supportEmptyParas]-->
- <!--[if !supportLists]-->Also add the code above to the Initial JavaScript box (Module Configuration, Custom JavaScript File
- Tick: “Initially hide form submission button” (Module Configuration/ Submit/Link Button). (You will see radio buttons in there. It doesn’t matter which one is used in this context. Style as necessary. eg change the button’s title from ‘Submit’ to, for example ‘Send Request’, ‘Apply’ etc)<!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->
Finished. On form opening you will see the “Do you agree…?” but not the Submit. Tick the former and Submit will appear. (Again, this is the Demo #7 approach.)
<!--[if !supportEmptyParas]--> <!--[endif]-->
Now for the more complicated case two: neither the checkbox /(“Do you agree to …..?”) nor Submit are visible on open. We want to see them much later. (And, of course, here Iam only dealing with the submit-related questions; no mention at all of any others that will end up on the form.)
<!--[if !supportEmptyParas]--> <!--[endif]-->
- Repeat the above process with two exceptions:
- DO NOT add the code above to the Initial JavaScript box (Module Configuration, Custom JavaScript File). Instead, add to that box only: hidehtml('SaveForm'). (Yes, confirmed, put it all in the Initial JavaScript box )
- DO tick the “Hide until forced visible by completion event” for the “Do you agree … “ question. (In the previous case the form opened with that question visible, in this one we are starting it off hidden.)
<!--[if !supportEmptyParas]--> <!--[endif]-->
- <!--[if !supportLists]-->Note, you could also add other ‘questions’ that you want to make visible at the same time as the “do you agree…?; perhaps making a section on the bottom of the form for them. eg you could add a CAPTCHA, and things like “Do you want to join our mailing list?” etc. Don’t forget to hide them. I would suggest, however, you keep it simple on the first pass. Get it to work and then come back and add the extras.<!--[endif]-->
<!--[endif]-->
- Work out where you want the checkbox /(“Do you agree to …..?”) to initially hide. That is, inside which Question Event will it sit. Let’s assume you don’t want it to appear until the user ticks “Do you want to proceed to the checkout?”
- Create that Question. It could be a Simple Checkbox as in the case above, or it could be another dynamic entity such as radios, a combo etc. Let’s make it a CheckBox and call it “Do you want to proceed to the checkout?” <!--[endif]-->
- Create a Question Event based on that Question.<!--[endif]-->
<!--[if !supportEmptyParas]-->
<!--[if !supportLists]-->o Open Question Events<!--[endif]-->
<!--[if !supportLists]-->o Select New Question Event<!--[endif]-->
<!--[if !supportLists]-->o Give it a name eg GoToCheckout<!--[endif]-->
<!--[if !supportLists]-->o Tick “Display hidden question based on another questions response’<!--[endif]-->
<!--[if !supportLists]-->o In Initial/Postback question select the Question you created above (Do you want to proceed to the checkout?” It’s the one you want a yes answer for.)<!--[endif]-->
<!--[if !supportLists]-->o Depending on the type of Dynamic Question (radio, combo etc), you will be presented with a choice of the responses that will trigger the event.<!--[endif]-->
<!--[if !supportLists]-->o If you are using a Simple Checkbox then put a tick in the Initial Response box. (ie if user ticks the box the event will take place)<!--[endif]-->
<!--[if !supportLists]-->o Choose the Affected Question (it’s “Do you agree …. ?” It’s the one(s) that will come visible with the yes answer.) [ps If you have added other questions, as noted above, then tick them here also.]<!--[endif]-->
<!--[if !supportEmptyParas]-->
All going well you will now have a cascade of questions:
- <!--[if !supportLists]-->On form open – only the “Do you want to go to the checkup?” [Of course, you could also put that inside another Question Event.]
- Tick that and “Do you agree …? , and others you have added, are revealed.<!--[endif]-->
- Tick that and “Submit” appears.<!--[endif]-->
<!--[if !supportEmptyParas]-->
Troubleshooting
- Watch the syntax – you have to get things like chk(ShowHide) spot on
- Check all your hides / make visibles
- Check you have the correct Dynamic Question and the Affected Question selected – don’t get them the wrong way around.
- And there are many “others”. I think I have found most!
<!--[if !supportEmptyParas]-->
I hope that helps someone.
Regards,
Gordon
<!--[if !supportEmptyParas]-->
PS I wasn’t going to ask a question , but there is one that may be of benefit to others heading down this path (sorry, ‘stream’!). The only (slight) hitch on my form is that if Submit is clicked without correct validation in all fields then, as expected, the error messages come up, BUT the submit button gets hidden. Users could be left stranded not knowing what to do next. My workaround is to put a note: “If fields not filled in … error message … add/correct …..” then invite them to un-click and then re-click the “Do you agree ….? box.” Not very elegant, but it works. Is there any way to not have the submit button hide on presentation of incorrect validation? Or perhaps have my note appear at the same time as the validation-error messages appear. That is, not have it there even when there isn’t a validation problem. Just a thought.
<!--[if !supportEmptyParas]-->
Again, my sincere thanks. Gordon