Determine if the user input address is local or network

Source: Internet
Author: User

<form id=upload2 name=upload2 action= "photo_diy2.asp" Method=post onsubmit= "return Validatediy (this);" Target=_ Blank>
<tr height=50>
&LT;TD valign= "Bottom" > or:</td>
&LT;TD valign= "Bottom" > found a good picture in the Web browsing want to directly processing edit, please enter the URL of this picture. </td>
</tr>
<tr>
&LT;TD align= "Right" ><input type=hidden name= "Uploadtype" value=1></td>
<td><input type= "text" name= "Picurl" value= "http://" size=75>
<input type= "Submit" value= "Next" ></td>
</tr>
<input name= "UploadFile" type=hidden>
</form>

JS function

function Validatediy (aform)
{
if (aform.uploadtype.value==1) {

if (!aform.picurl.value | | (aform.picurl.value== "http://"))
{
Alert ("Please enter the network address of the picture you want to send!") ");
AForm.picurl.focus ();
return (false);
}
Else
{
Aform.uploadfile.value=aform.picurl.value;
aform.action= ' photo_diy2.asp?uploadtype=1 ';
return (true);
}
}
else if (aform.uploadtype.value==0) {
if (!aform.picfile.value) {
Alert ("Please enter the local picture in your computer!") ");
AForm.picfile.focus ();
return (false);
}else{
if (Checkpic ()) {
Aform.uploadfile.value=aform.picfile.value;
aform.action= ' photo_diy2.asp?uploadtype=0 ';
return (true);
}else{
return (false);
}
}

}


}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.