mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-16 12:21:13 +00:00
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@692 e7d03fd6-7b0d-0410-9947-9c21f3af8025
23 lines
714 B
Text
23 lines
714 B
Text
- Javascript in CGI scripts
|
|
<form onsubmit=return(isRequired(document.checklinkForm)) name=checklinkForm ...>
|
|
</form>
|
|
|
|
//Check for the required fields
|
|
function isRequired (thisForm) {
|
|
var empty = false;
|
|
// URI
|
|
if (isEmpty(thisForm.uri) || (thisForm.uri.value == "http://")) {
|
|
alert("The URL field is required. Please fill it in.");
|
|
thisForm.uri.select();
|
|
thisForm.uri.focus();
|
|
empty = true;
|
|
}
|
|
// verify URL format
|
|
if ((empty == false) && (verifyURI(thisForm.uri) == false)) {
|
|
alert("Invalid URL submitted. Please submit a valid URL.");
|
|
thisForm.uri.select();
|
|
thisForm.uri.focus();
|
|
empty = true;
|
|
}
|
|
return (!(empty));
|
|
}
|