background image

<td> 
<select name="img_select" onchange="img_change(this)"> 
<option value="101" >女 001</option> 
<option value="102" >女 002</option> 
<option value="103" >女 003</option> 
<option value="104" >女 004</option> 
<option value="105" >男 001</option> 
<option value="106" >男 002</option> 
<option value="107" >男 003</option> 
<option value="108" >男 004</option> 
</select> 
<img src="/bbs/img/101.gif" id="tx_change" style="width:50px; height:65px;" alt=""/> 
</td> 
</tr> 
<tr height="20" align="justify"> 
<td align="right" ><input type="submit" value="注册" name="submit" style="margin-
right:5px;"/></td> 
<td><input type="reset" value="重置" name="reset" style="margin-left:5px;"/></td> 
</tr> 
<tr> 
<td colspan="2">我已有账号现在<a href="login.php">登录</a></td> 
</tr> 
</table> 
</form> 
</body> 
</html> 
 
func.js 
 代码如下:
 

//根据下拉框变换图片 
function

 img_change(thisObj){ 

var

 imgsrc = "/bbs/img/"+ thisObj.value+".gif"; 

document.getElementById("tx_change").src=imgsrc; 

//检查是否都符合 注册 要求 
function

 check_reg() 

if

(check_len() && check_pass() && check_email() && check_qq()) 

return

 true; 

}

else

return

 false;