If the drop-down list box or file box is empty during file upload, an error is returned.
Here we will solve this problem.
Extract A test of the value in the drop-down box:
<Body>
Please provide the value of the drop-down box:
<Select name = "mychoise" onpropertychange = "A ()">
<Option selected> select </option>
<Option> 1 </option>
<Option> 3 </option>
<Option> 5 </option>
</SELECT>
<SCRIPT languange = "JavaScript">;
Function (){
Window. Confirm (document. All. mychoise. Options [document. All. mychoise. selectedindex]. Text );
}
</SCRIPT>
</Body>
The following is a specific list box:
<Select id = select1 name = machtype>
<Option value = "" selected> -- select the mobile phone model -- </option>
<%
DS = (Dataset) request. getattribute (enumconstant. machtype );
DS. First ();
Do {
%>
<Option value = <% = Ds. getstring ("mach_type") %> <% = Ds. getstring ("mobile_name") %> </option>
<%
}
While (Ds. Next ());
String S;
%>
</SELECT>
The following is a file control:
<Input name = "myfile" type = "file" size = "30">
The final result is judgment. If it is null, it will not be processed:
<Script language = JavaScript>
Function uploadfile (){
If (document. uploadform. myfile. value! = "") & (Document. uploadform. machtype. value! = "")){
Uploadform. Submit ();}
}
</SCRIPT>