¿Hay alguna forma sencilla de activar o desactivar un botón de opción, cuando se hace clic en un texto cercano sin introducir un gran marco de Javascript en mi pequeño proyecto PHP?Alternar el botón de opción HTML haciendo clic en su etiqueta
El formulario web tiene el siguiente aspecto:
<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>
Esto hace que diseñar la etiqueta sea más difícil y requiere envolver su texto en más elementos. – Soviut
Sí, pero si no está estilizando, es más fácil obtener la funcionalidad que desea. No me gusta tener que agregar ID extra y atributos "para". –
+1 Las identificaciones pueden ser muy malas, así que es mejor evitarlas como regla general –