html標籤的運用modify.html

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<script>
window.οnlοad=function(){
if(<{$data.sex}> == 0){
document.getElementsByName('sex')[1].checked=true;
}else{
document.getElementsByName('sex')[0].checked=true;
}
}
</script>
<body>
<form action="/thinkphp/index.php/User/update" method='post'>
<input type="hidden" name="id" value="<{$data.id}>">
姓名:<input type="text" name="username" value="<{$data.username}>"/><br/>
性別:男 <input type="radio" name="sex" value="1" checked/>
女<input type="radio" name="sex" value="0"/><br/>
<input type="submit" value="提交修改"/>
</form>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章