I'm using the standard Profiles module (D6) to extend the user registration form and I have one checkbox I'd like to have the default value of checked rather than unchecked. The code I think I need to add to the form would be the checked bit below:

<input id="edit-profile-hbn-newsletter" checked="checked" class="form-checkbox" type="checkbox" value="1" name="profile_hbn_newsletter"/>

I don't seem to have the option of doing this anywhere in the administration of the profiles and after searching a lot I've seen the same question unanswered so I don't hold out much hope of being able to do this!

Any ideas?

Thanks

David

Comments

Johnywoo’s picture

Sorry miss post

thomjjames’s picture

Hi,

You could try doing it with jQuery:

$("input#edit-profile-hbn-newsletter").attr("checked", true);

If that doesn't work try:

$("input#edit-profile-hbn-newsletter").get(0).checked = true;

this is untested and i'm no jQuery expert but i think it should work

Cheers
Tom
______________________________________________
http://drupalsn.com/user/thomjjames

______________________________________________
https://tomswebstuff.com