I want a news letter subscribe box checked by default. Is there anywhere in the form code below I can change something to get the box checked by default? Here is the form code: <input type="checkbox" name="subscribed" class="textbox" value="1" <?php if(isset($_REQUEST["subscribed"])){echo "checked";}?> />
Add another variable to a form that will tell you if the form was submitted (ie. <form type="hidden" name="submitted" value="1">. In your original code change the if statement to read: if(!isset($_REQUEST['submitted']) || isset($_REQUEST["subscribed"])) {echo "checked";}
Great, so the code that works and I use now is: <input type="checkbox" form type="hidden" name="subscribed" class="textbox" value="1" <?php if(!isset($_REQUEST['submitted']) || isset($_REQUEST["subscribed"])) {echo "checked";}?> /> Green to you. chicagoweb, you are an expert, could you please take a look at this: http://forums.digitalpoint.com/showthread.php?t=500979 I need the keywords in the h1 tag to show up in the title tag, how can I do that?
Thanks tamen, could you please take the time to incorporate that in the code for me, show me how the complete line would look. I dont understand really what you mean. I dont know php at all actually.
<input type="checkbox" form type="hidden" name="subscribed" class="textbox" value="1" <?php if(!isset($_REQUEST['submitted']) || isset($_REQUEST["subscribed"])) {echo 'checked="checked"';}?> />