none
form提交的问题 RRS feed

  • 问题

  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE></TITLE>
    <SCRIPT language=JavaScript>
    <!--
    function checks()
    {
    	var strchoice="";
    	var i=document.myform1.tp2.length;
        	var k=0;
    	for(var j=0;j<i;j++){
            	if(document.myform1.tp2[j].checked){
            		strchoice=strchoice+document.myform1.tp2[j].value+",";
                		++k;
            	}
      }
        if (k==0){
    	 	alert("请最少选择一个候选......");
    	 	return false;
        }
        if (k>10){
    	 	alert("请最多选择十个候选......");
    	 	return false;
        }    
        
    strchoice=strchoice.substring(0,strchoice.length-1); 
    document.myform1.choiceid.value=strchoice; 
    if(document.myform1.choiceid.value=="")
    {
    	alert("请最少选择一个候选......");
    	return false;
    }
    return true;
    }
    //-->
    </SCRIPT>
    <STYLE type=text/css>BODY {
    	BACKGROUND-COLOR: #900808; MARGIN: 0px
    }
    .style1 {
    	COLOR: #900808
    }
    .STYLE2 {
    	FONT-SIZE: 12px
    }
    .style4 {
    	FONT-FAMILY: "微软雅黑", "黑体"; COLOR: #ae0000; FONT-SIZE: xx-large
    }
    BODY {
    	COLOR: #900808
    }
    TD {
    	COLOR: #900808
    }
    TH {
    	COLOR: #900808
    }
    </STYLE>
    <META content="text/html; charset=gb2312" http-equiv=Content-Type>
    <META name=GENERATOR content="MSHTML 8.00.6001.23181"></HEAD>
    <BODY>
    <DIV>
    <TABLE border=0 cellSpacing=0 cellPadding=0 width=980 align=center height=440>
      <TBODY>
      <TR>
        <TD>&nbsp;</TD></TR></TBODY></TABLE>
    <TABLE border=0 cellSpacing=0 cellPadding=0 width=980 align=center>
      <TBODY>
      <TR>
        <TD vAlign=top width=310></TD>
        <TD vAlign=top>
          <TABLE border=0 cellSpacing=0 cellPadding=0 width=665 align=right>
            <TBODY>
            <TR>
              <TD>
                <TABLE border=0 cellSpacing=0 cellPadding=0 width=665 height=12>
                  <TBODY>
                  <TR>
                    <TD></TD></TR></TBODY></TABLE>
                <TABLE border=0 cellSpacing=0 cellPadding=0 width=665 
                bgColor=#fbf3cf>
                  <TBODY>
                  <TR>
                    
                    </TR>
                  <TR vAlign=bottom>
                    <TD height=80 colSpan=2>
                      <DIV class=style4 
                align=center></DIV></TD></TR></TBODY></TABLE></TD></TR>
            <TR>
              <TD>
                <TABLE border=0 cellSpacing=0 cellPadding=0 width=665 
                bgColor=#fbf3cf height=1750>
                  <FORM onSubmit="return checks();" method=post name=myform1 
                  action=test.aspx>
                  <TBODY>
                  <TR>
                    <TD>
                      <TABLE border=0 cellSpacing=0 cellPadding=0 width=665 
                      height=300>
                        <TBODY>
                        <TR>
                          <TD width="25%">
                            <DIV align=center>
                            <TABLE border=0 cellSpacing=0 cellPadding=0 width=145 
                            height=300>
                              <TBODY>
                              <TR>
                                <TD>
                                  
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30 align=middle><INPUT value=101 
                                  type=checkbox name=tp2> 编号:101</TD></TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30>&nbsp;</TD>
                              </TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=70 vAlign=top><SPAN 
                                  class=STYLE2></SPAN></TD></TR></TBODY></TABLE></DIV></TD>
                          <TD width="25%">
                            <DIV align=center>
                            <TABLE border=0 cellSpacing=0 cellPadding=0 width=145 
                            height=300>
                              <TBODY>
                              <TR>
                                <TD>&nbsp;</TD>
                              </TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30 align=middle><INPUT value=102 
                                  type=checkbox name=tp2> 编号:102</TD></TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30><SPAN class=STYLE2></SPAN></TD></TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=70 vAlign=top><SPAN 
                                  class=STYLE2></SPAN></TD></TR></TBODY></TABLE></DIV></TD>
                          <TD width="25%">
                            <DIV align=center>
                            <TABLE border=0 cellSpacing=0 cellPadding=0 width=145 
                            height=300>
                              <TBODY>
                              <TR>
                                <TD>
                                  </TD></TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30 align=middle><INPUT value=103 
                                  type=checkbox name=tp2> 编号:103</TD></TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30>&nbsp;</TD>
                              </TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=70 vAlign=top>&nbsp;</TD>
                              </TR></TBODY></TABLE></DIV></TD>
                          <TD width="25%">
                            <DIV align=center>
                            <TABLE border=0 cellSpacing=0 cellPadding=0 width=145 
                            height=300>
                              <TBODY>
                              <TR>
                                <TD>
                                  </TD></TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30 align=middle><INPUT value=104 
                                  type=checkbox name=tp2> 编号:104</TD></TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=30>&nbsp;</TD>
                              </TR>
                              <TR>
                                <TD 
                                style="LINE-HEIGHT: 22px; PADDING-LEFT: 7px; FONT-SIZE: 12px" 
                                height=70 vAlign=top>&nbsp;</TD>
                              </TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></TD></TR>
                  
                  <TR><INPUT type=hidden name=choiceid> 
                    <TD align=middle><INPUT class=button value="          我要提交          " type=submit name=Submit></TD></TR>
                  <TR>
                    <TD 
            align=middle>&nbsp;</TD></TR></FORM></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
    <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
      <TBODY>
      <TR>
        <TD height=25></TD></TR>
      <TR>
        <TD bgColor=#770000 height=5></TD></TR>
      <TR>
        <TD bgColor=#ffffff height=120 align=middle></TD></TR></TBODY></TABLE></DIV></BODY></HTML>

    请教下各位 这个form提交到 test.php 可以直接写成url的形式吗比如:http://127.0.0.1/test.php?id=1&tp2=101  请教下各位高手
    2012年12月21日 2:02

答案

全部回复