1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

帮看看这代码哪错了!

本帖由 OUYANG2005-12-24 发布。版面名称:前端开发

  1. OUYANG

    OUYANG New Member

    注册:
    2005-09-06
    帖子:
    3,025
    赞:
    5
    代码:
    function check1(obj){
    var url=""
    var keykey=obj.keykey.value
    var lindex=obj.category.options[obj.category.selectedIndex].value
    if (lindex!="更多"){
    if(lindex==0) url="/search.php?type=radio CHECKED value=all name=s_type//全部
    if(lindex==1) url="/search.php?name=pwuser//用户
    location.href=url}
    else{location.href="http://www.dgdown.com/search.php"}
    return false
    }
    
    function gotourl(selObj){
    if(selObj.options[selObj.selectedIndex].value=="更多"){location.href="http://www.dgdown.com/search.php"}}
    
    function WriteSearch(selectedid){
    document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0"><form name=form1 method=post  target=_blank onSubmit="return check1(this);"><tr><td width="88" align="center">')
    document.write('<select name="category" class="clsdiv" onChange="gotourl(this)">')
    if (selectedid=='0'){document.write('<option value=0 selected>全 部</option>')}else{document.write('<option value=0>全 部</option>')}
    if (selectedid=='1'){document.write('<option value=1 selected>用 户</option>')}else{document.write('<option value=1>用 户</option>')}
    document.write('<option Value="更多">更 多...</option>')
    document.write('</select></td><td width="370"><input name="keykey" type="text" size="50" class="clsdiv"></td><td width="16"></td><td width="102"><INPUT type=image src="images/search_Pic.jpg" width="50" height="27"  border=0 name=imageField2></td><td>&nbsp;</td></tr></form></table>')}