+ -
当前位置:首页 → 问答吧 → 请教一下,这样的表单该怎么写?

请教一下,这样的表单该怎么写?

时间:2010-10-22

来源:互联网


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> #min{ width:20px; } </style> </head> <body> <form method="post"> <p> <input type="radio" id="always_tip" name="con_group" /><label for="always_tip">总是提示</label> </p> <p> <input type="radio" id="no_tip" name="con_group" /><label for="no_tip">从不提示</label> </p> <p> <input type="radio" id="after_tip" name="con_group" /> <label for="after_tip">每<input type="text" id="min" value="10" />分钟后提示</label> </p> </form> </body> </html>
 提示:您可以先修改部分代码再运行
代码如上,我是在一个label加入了一个文本框,但是我觉得这样写很不好,而且在ff下,文本框没法得到焦点,因为点击label就会把焦点移到单选按钮上,所以想请教大家,这样的表单该怎么写比较好了,谢谢!

作者: chenli11   发布时间: 2010-10-22


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> *{list-style:none;margin:0;padding:0;} #min{width:20px;} </style> </head> <body> <form id="form1" name="form1" method="post" action=""> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="2%"><label> <input type="radio" name="radio" id="radio" value="radio" /> </label></td> <td colspan="3">总是提示</td> </tr> <tr> <td><label> <input type="radio" name="radio2" id="radio2" value="radio2" /> </label></td> <td colspan="3">从不提示</td> </tr> <tr> <td><label> <input type="radio" name="radio3" id="radio3" value="radio3" /> </label></td> <td width="2%">每</td> <td width="2%"><input type="text" id="min" value="10" /></td> <td>分钟后提示</td> </tr> </table> </form> </body> </html>
 提示:您可以先修改部分代码再运行
[ 本帖最后由 xuexianli 于 2010-10-22 11:53 编辑 ]

作者: xuexianli   发布时间: 2010-10-22