//dont know what u r trying to do . i've modified ur code check this
//change the submit button to input type ="submit", called the form validn in the form onsubmit
<SCRIPT LANGUAGE="JavaScript">
<!--
function Update()
{
document.forms[0].action = 'welcome.asp?ID=<%= trim( session("ID")) %>';
document.forms[0].submit()
}
// -->
</SCRIPT>
<Script language ="JavaScript">
// Javascript checks for Registration Form
function submitform(){
//Enter a FirstName
if (Register.cvfile.value==""
alert("No file was selected.")
Register.cvfile.focus();
return false;
}
}
</script>
<Script language ="JavaScript">
extArray = new Array(".doc", ".txt");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file)
{
alert("Please Select A File")
form.File1.focus()
return false;
}
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\
ext = file.slice(file.indexOf(".
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit)
{form.submit();
return true;
}
else
{
alert("Please only upload files that end in types: "
+ (extArray.join(" ")) + "\nPlease select a new "
+ "file to upload and submit again.");
return false;
}
}
</script>
</HEAD>
<body>
<form action="uploaddb.asp" name = "frm" ENCTYPE="MULTIPART/FORM-DA
<table width="731" border="0">
<tr>
<th scope="row" colspan="2" align="left">Please Submit Your CV</th>
</tr>
<tr>
<td colspan="2" align="left">Please click the browse button to locate your file on your computer. Then Click "Upload File"</td>
</tr>
<tr>
<td colspan="2" scope="row" height="20"><div align="left"> </td>
</tr>
<tr>
<td colspan="2" scope="row"><div align="left"><input type=file name=File1 size="20">
</div></td>
</tr><p>
<tr>
<td colspan="2" scope="row" height="20"><div align="left"> </td>
</tr>
<tr>
<td><input type=submit name="Submit" value="Submit" > &
<input type="button" name="update" value="New profile" ONCLICK="Update();"></td>
</tr>
<tr>
<td colspan="2" scope="row" height="20"><div align="left"> </td>
</tr>
</table>
</form>
Main Topics
Browse All Topics





by: GwynforWebPosted on 2005-07-04 at 20:30:19ID: 14365668
If you let us know the complete required validation it might be easier to rewrite the code, it wil not take long. It is a little bit of a muddle at the moment.