Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 11th Feb 2011, 08:03 PM   #1
HyperActive Warrior
War Room Member
 
davidmeeonline's Avatar
 
Join Date: 2010
Location: Perth, Australia
Posts: 231
Thanks: 69
Thanked 45 Times in 34 Posts
Default
Setting a checkbox as "on" by default
Share on: 
fb share twitter share gplus share more share

Hi Warriors

I am trying to turn a checkbox on by default, so that everytime I create a new post in wordpress, it is automatically enabled. The bit of offending code is

<div style='display: none;' class='edit_stock'>
";
echo "<p><strong class='wpsc_error'>" .__('Note: If you are using variations please ensure you populate the stock under "Variation Control"', 'wpsc')."</strong></p>";
echo __('Stock Qty', 'wpsc') . " <input type='text' name='quantity' value='0' size='10' />";
echo "<div style='font-size:9px; padding:5px;'><input type='checkbox' class='inform_when_oos' name='inform_when_oos' /> " . __('If this product runs out of stock set status to Unpublished & email site owner', 'wpsc') . "</div>";
echo "</div>";

I know it is this line, but nothing I have tried will work.

Any help?

Cheers
davidmeeonline is offline  
Unread 11th Feb 2011, 08:16 PM   #2
HyperActive Warrior
War Room Member
 
michael_gourlay's Avatar
 
Join Date: 2010
Location: New Jersey, USA
Posts: 102
Thanks: 4
Thanked 18 Times in 16 Posts
Default
Re: Setting a checkbox as "on" by default
Share on: 
fb share twitter share gplus share more share

Have you tried setting the checked attribute on the input tag?

If so, maybe there is some javascript or something on the page setting it to not checked?
michael_gourlay is offline  
Unread 12th Feb 2011, 02:08 AM   #3
Active Warrior
 
Join Date: 2011
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: Setting a checkbox as "on" by default
Share on: 
fb share twitter share gplus share more share

ya like michael wrote all you need to do is set the checked attribute. This is the code: checked="true".
nxtgencreative is offline  
Unread 12th Feb 2011, 04:54 AM   #4
Active Warrior
 
Join Date: 2010
Posts: 36
Thanks: 0
Thanked 5 Times in 5 Posts
Default
Re: Setting a checkbox as "on" by default
Share on: 
fb share twitter share gplus share more share

add checked to the tag (see example)
[QUOTE]<input type='checkbox' CHECKED class='inform_when_oos' name='inform_when_oos' />[/QUOTE]

Silke is offline  
Unread 12th Feb 2011, 07:20 PM   #5
HyperActive Warrior
War Room Member
 
davidmeeonline's Avatar
 
Join Date: 2010
Location: Perth, Australia
Posts: 231
Thanks: 69
Thanked 45 Times in 34 Posts
Default
Re: Setting a checkbox as "on" by default
Share on: 
fb share twitter share gplus share more share

Thanks guys, will give it a try tonight!
davidmeeonline is offline  
Closed Thread


Bookmarks

Tags
checkbox, default, setting


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 09:08 AM.