Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

skipping checkboxes based on user input 1

Status
Not open for further replies.

tburke

Programmer
Joined
Jan 15, 2003
Messages
5
Location
US
I have been seeking a solution in the javascripting scripting forum but have found 'disabling checkboxes' disables all checkboxes in the form and a more recent solution that was proposed I could not get onblur to skip checkboxes.

I am looking to improve the speed of filling in a lengthy form by allowing users to skip boxes when their response is 'no' by using tab that is much faster than lifting hands off the keyboard to move a mouse

So, when a user does not send out a worker, (not clicked) focus should automatically skip down to placement box. However, if they click yes to 'sending out a worker', focus (via tab) allows them to tab through sit, transport, investigate and other box before placement box.

If they do not place a youth...tab key moves focus to transportation question...(in placement, i have omitted 18 choices for simplicity)

here is a stripped version of the form...without all the placement choices...the program is about 4 feet long.

Any help would be greatly appreciated.

Ps-I have spent most of the last 2 days working getting this function to work. I know this one does not work..but I am worn out....

<cfoutput>
<SCRIPT LANGUAGE=Javascript>
// tests when cgo blurs...skips to placement...not working
Function testWkr();
If (document.myform.cgo.checked == false){
document.myform.placement.focus();}
</SCRIPT>
</cfoutput>


Here is the stripped coding that i copied from homesite that i have been tweaking on a cold fusion web site.
Thanks in advance for any help.


<form name="myform" action="inserttest.cfm" method="POST">
<input TYPE="Text" NAME="start" SIZE="20" VALUE="start here tab next box"><br>

<em><b>Send out SRS Wkr?:</b></em><br>
Yes<input TYPE="checkbox" name="cgo" onblur="testWkr()";>
&nbsp;&nbsp;<em><b>To: <font size="-1">(check all that apply)</font></b></em><br>
<input TYPE="checkbox" name="whygo1" value="sit" >sit<br>
<input TYPE="checkbox" name="whygo2" value="transport">transport<br>
<input TYPE="checkbox" name="whygo3" value="investigate">investigate<br>
<input TYPE="checkbox" name="whygo" value="other">other<br>
<hr>
Was the youth placed?
Yes<INPUT TYPE="checkbox" name="placement" value="y"><br>
<hr>
Youth transported?
Yes<INPUT TYPE="checkbox" name="transported" value="y"><br>
</p>
<input value="Submit"type="submit">
</body>
</html>
 
Hi mate,

As you need this to run after the page is loaded, you would need to use a client-side scripting, Coldfusion would not be able to do anything like this.

The only way you could do something even remotely similar to this with CF would be to submit the form when they select no and then load the form again and hide the checkboxes.

Have you considered breaking the form into multiple pages and displaying the required options based on their selections?

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Wullie,
Thanks. Your suggestion is very good and will be my choice if I can not get javascripting to work. After reflecting on it I can ask the four main questions and by breaking it into four sections, only reload those needing further input. Fast, efficient and there is a psychological factor to the user...the form appears shorter and work goes faster...less real estate to cover with tabs or mouse clicks.
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top