if checkbox checked display text in user profile?
Permalink
Hi,
I've put some extra attributes onto the registration page of my site in the way of checkboxes.
I'm looking to display some text on the profile page IF a checkbox is ticked
i.e. if checkbox 1 is ticked display "text A"
if checkbox 2 is checked display "Text B"
if checkbox 3 is unticked "text C" is hidden
IS there anyway to do this?
I guess there is some java involved to show or hide the text, but I'm a little unsure of both the java and where the code should go, as its not on the profile.php file, nor view.php, and I'm unsure how to use the form helper
I hope this makes sense and someone can help me out, it seems like a simple thing to do....but it isn't!
Thanks in advance
I've put some extra attributes onto the registration page of my site in the way of checkboxes.
I'm looking to display some text on the profile page IF a checkbox is ticked
i.e. if checkbox 1 is ticked display "text A"
if checkbox 2 is checked display "Text B"
if checkbox 3 is unticked "text C" is hidden
IS there anyway to do this?
I guess there is some java involved to show or hide the text, but I'm a little unsure of both the java and where the code should go, as its not on the profile.php file, nor view.php, and I'm unsure how to use the form helper
I hope this makes sense and someone can help me out, it seems like a simple thing to do....but it isn't!
Thanks in advance
You don't need to use the "name" attribute when you select it with jquery. Using the ID or a class would work.
Try:
[code]$('#lets').live('change', function() {
//code
});
I wouldn't mess around with the form name unless you know exactly where it's posting to and how that will affect the rest of the process. Just use the ID or assign classes to the checkboxes.
Try:
[code]$('#lets').live('change', function() {
//code
});
I wouldn't mess around with the form name unless you know exactly where it's posting to and how that will affect the rest of the process. Just use the ID or assign classes to the checkboxes.
I have included this jquery
My problem lies in this #ak[19][value]
I know this is some form of attribute which has returned this. What I want to know is how to tell the jquery to run on th correct name?
The code for the checkbox is returned like this
Any ideas?