Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
140
rated 0 times [  143] [ 3]  / answers: 1 / hits: 105834  / 14 Years ago, thu, november 18, 2010, 12:00:00

Is there please a simple way to make a radio button toggle - when a text near it is clicked - without introducing any big Javascript Framework into my smal PHP project?



The web form looks like this:



<html>
<body>
<form method=post>
<p>Mode:<br />
<input type=radio name=mode value=create><i>create table</i><br />
<input type=radio name=mode value=select checked>select records (can specify id)<br />
<input type=radio name=mode value=insert>insert 1 record (must specify all)<br />
<input type=radio name=mode value=delete>delete records (must specify id)<br />
<input type=radio name=mode value=drop><i>drop table</i><br />
</p>
<p>Id: <input type=text name=id size=32 maxlength=32 /> (32 hex chars)</p>

<p>Latitude: <input type=text name=lat size=10 /> (between -90 and 90)</p>
<p>Longitude: <input type=text name=lng size=10 /> (between -90 and 90)</p>
<p>Speed: <input type=text name=spd size=10 /> (not negative)</p>
<p><input type=submit value=OK /></p>
</form>
</body>
</html>

More From » html

 Answers
29

You can also wrap your elements without giving them each an ID, since a <label> is implicitly for the input it contains, like this:



<label>
<input type=radio name=mode value=create>
<i>create table</i>
</label>

[#94921] Tuesday, November 16, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
frederickmohamedw

Total Points: 21
Total Questions: 123
Total Answers: 105

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
frederickmohamedw questions
Wed, Sep 23, 20, 00:00, 4 Years ago
Sat, Jul 18, 20, 00:00, 4 Years ago
Sun, Apr 26, 20, 00:00, 4 Years ago
Sat, Jan 11, 20, 00:00, 4 Years ago
Fri, Dec 27, 19, 00:00, 4 Years ago
;