| | |
make a radio button checked if it was selected before
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2008
Posts: 3
Reputation:
Solved Threads: 0
hi
,
I want to make a radio button checked if the form is already submitted. The form and output are on the same page. I have 2 (later more) radio buttons and i want the form to 'remember' the state of the button, e.g. insert a checked="checked" text in the form.
I tried 36 variations on this code:
I keep getting syntax errors.
Any help appreciated
I want to make a radio button checked if the form is already submitted. The form and output are on the same page. I have 2 (later more) radio buttons and i want the form to 'remember' the state of the button, e.g. insert a checked="checked" text in the form.
I tried 36 variations on this code:
php Syntax (Toggle Plain Text)
<p><input name="cref" type="radio" value="http://games.allemaal.info/context-g4g-nl.xml" <?php if ($_GET["cref"]=="http://games.allemaal.info/context-g4g-nl.xml") echo "checked="checked""; ?>/> Google for Games</p>
I keep getting syntax errors.
Any help appreciated
•
•
Join Date: Nov 2008
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Hi I have the same problem. I tried to escape quotes but still doesn't work. Do u mind posting the changed code? Thanks.
PHP Syntax (Toggle Plain Text)
<!-- now, the radio buttons need to remember the state they where in, so the user doesn't have to click the radio button everytime they do a new search--> <p><input name="cref" type="radio" value="http://games.allemaal.info/context-g4g-nl.xml" <?php if ($_GET["cref"]=="http://games.allemaal.info/context-g4g-nl.xml") echo "checked=\"checked\""; ?>/> Free online games</p> <p> <input name="cref" type="radio" value="http://games.allemaal.info/context-g4g-nl-wow.xml" <?php if ($_GET["cref"]=="http://games.allemaal.info/context-g4g-nl-wow.xml") echo "checked=\"checked\""; ?> /> World of Warcraft</p>
![]() |
Similar Threads
- Radiobutton Problem (ASP.NET)
- Trouble with select button, please help! (VB.NET)
- Spyfalcon and some other virus (Viruses, Spyware and other Nasties)
- I have a virus or Trojan? (Viruses, Spyware and other Nasties)
- Spyfalcon & Malwarewipe, and I can't get ride of it! (Viruses, Spyware and other Nasties)
- Im getting a virus alert and Spyfalcon alert in my toolbar!!! (Viruses, Spyware and other Nasties)
- please help!! (Viruses, Spyware and other Nasties)
- calling functions (ASP.NET)
- Trying to get rid of Hacktool.rootkit (Viruses, Spyware and other Nasties)
- javascript: radio buttons (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: Extracting barcode reader dat through web interface
- Next Thread: blog software
Views: 4173 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms soap source space speed sql static structure syntax system table tutorial up-to-date update updates upload url validation validator variable video web wordpress xml youtube





