Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Target CheckBoxes with selections on tree
wicked
Junior Member

Posts: 6
Registered: 6/23/2005
Location: boston
Member Is Offline
posted on 6/23/2005 at 11:41 PM Reply With Quote
Target CheckBoxes with selections on tree


Is there a way to set up the target to be a checkbox in a form. I have a checkbox form next to the tree...I'm trying to set it up so when a user selects something on the tree it checks off a corosponding checkbox on my form any ideas?
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 6/24/2005 at 10:28 AM Reply With Quote

Use javascript as item's link. E.g.:
['item (un)checks checkbox', 'javascript:my_function_for_ckecking("checkbox_id")']
View User's Profile View All Posts By User U2U Member
wicked
Junior Member

Posts: 6
Registered: 6/23/2005
Location: boston
Member Is Offline
posted on 6/24/2005 at 06:19 PM Reply With Quote

Great!! thanks for the help...by the way you wouldn't happen to know of any java script funtions I could use for the call

IE. 'javascript:my_function_for_ckecking

Kind of a newbie at this would greatly appreciate all the help i could get.

thanks again.
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 6/24/2005 at 07:47 PM Reply With Quote

Try something like
function my_function_for_ckecking (s_checkbx_name) {
var o_form = document.forms['my_form_name'];
var o_cbx = o_form.elements[s_checkbx_name];
if(o_cbx) o_cbx.checked = !o_cbx.checked; //toggle
}
View User's Profile View All Posts By User U2U Member
wicked
Junior Member

Posts: 6
Registered: 6/23/2005
Location: boston
Member Is Offline
posted on 6/24/2005 at 08:30 PM Reply With Quote

Hmm still not working out so good here is the code in place:

In the tree_items.js config file:

var TREE_ITEMS = [
['My Worklists', null,
['item (un)checks checkbox',

'javascript:my_function_for_ckecking("Q1-1_chk4")']
]

The form in the main page:

<script language="JavaScript">
<!--
function my_function_for_ckecking(s_checkbx_name)
{var o_form = document.forms['form_1'];
var o_cbx = o_form.elements[s_checkbx_name];
if(o_cbx) o_cbx.checked = !o_cbx.checked; //toggle
}
//-->
</script>


<form name="form_1" method="post" action="">
<input name="Q1-1_chk4" type="checkbox" id="Q1-1_chk4" value="test">
test
</form>

It's actually opening another window when i click the link.

Thank you so much the way I appreciate all the help you are giving in advance
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 6/25/2005 at 07:09 PM Reply With Quote

The correct syntax is:
var TREE_ITEMS = [
['My Worklists', null,
['item (un)checks checkbox', "javascript:my_function_for_ckecking('Q1-1_chk4')"]
]
]

Also check target setting (tree_tpl.js):
var TREE_TPL = {
'target' : '_self', // name of the frame links will be opened in
...
}
View User's Profile View All Posts By User U2U Member
wicked
Junior Member

Posts: 6
Registered: 6/23/2005
Location: boston
Member Is Offline
posted on 6/25/2005 at 07:20 PM Reply With Quote

Ok Thanks for the info....one last Q should I keep this function:


<script language="JavaScript">
<!--
function my_function_for_ckecking(s_checkbx_name)
{var o_form = document.forms['form_1'];
var o_cbx = o_form.elements[s_checkbx_name];
if(o_cbx) o_cbx.checked = !o_cbx.checked; //toggle
}
//-->
</script>

In the head of the main page or does this need to go into the tree.js file?
View User's Profile View All Posts By User U2U Member
wicked
Junior Member

Posts: 6
Registered: 6/23/2005
Location: boston
Member Is Offline
posted on 6/25/2005 at 07:33 PM Reply With Quote
AWSOME!!!!!!!!!!!!!!


MAN, You ROCK HARDCORE!!!....I just got it to work and I'm absolutely psyched!!! Thanks for sticking with me...You will never know how much I appreciate this help

Outstanding work ;)
View User's Profile View All Posts By User U2U Member
wicked
Junior Member

Posts: 6
Registered: 6/23/2005
Location: boston
Member Is Offline
posted on 6/25/2005 at 09:29 PM Reply With Quote
One more time please


ok ok ok one last question since I know your good at this....

I've got a pretty large form of checkboxes somewhere in the 3-400 range clicking the link will check the box but the user has no idea the box has been checked really unless they scroll down. The checkboxes are arranged in categories mimicking the tree. Either I'd like to set up anchors at each checkbox section so after they click the link in the tree it brings them to the spot where the checkbox is. than they could just click a simple #top link to get back up to the tree (that part I can do). But can I add this into the existing function something like:

<script language="JavaScript">
<!--
function my_function_for_ckecking(s_checkbx_name,anchor)
{var o_form = document.forms['form_1'];
var o_cbx = o_form.elements[s_checkbx_name];
if(o_cbx) o_cbx.checked = !o_cbx.checked; //toggle
onclick=document.location=[anchor]; <--- just a guess
}
//-->
</script>

Does that make sense?
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004