Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 12 February 2009 :  16:08:03  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
hiya,

i have a small problem, not perticuarlly forum related but maybe somone knows how to help me out.

basically i need to combine 2 bits of javascript but i dont know enough javascript to do it.

<script  language="JavaScript">
<!-- Hide from older browsers...
//Function to check form is filled in correctly before submitting
function CheckForm () {

var errorMsg = "";

//Check for a Name
if (document.MyForm.Name.value==""){
errorMsg += "\n\tName \t\t- Please Enter Your Name!";
}

//Check for Comments
if (document.MyForm.Comments.value==""){
errorMsg += "\n\tCommentss \t- Please Enter Description Of The File Being Uploaded!";
}

//Check for File to be uplaoded
if (document.MyForm.FILE1.value==""){
errorMsg += "\n\tFile \t- Please Select A File To Be Uploaded!";
}

//If there is a problem with the form then display an error
if (errorMsg != ""){
msg = "____________________________________________________________________\n\n";
msg += "Your File has not been submitted because there are problem(s) with the form.\n";
msg += "Please correct the problem(s) and re-submit the form.\n";
msg += "____________________________________________________________________\n\n";
msg += "The following field(s) need to be corrected: -\n";

errorMsg += alert(msg + errorMsg + "\n\n");
return false;



}

return true;
}
// -->
</script>


this bit of javascript is called with the onSubmit function, and if there isnt any errors with the form, it then needs to run this bit of code.

<SCRIPT LANGUAGE="JavaScript">
function ShowProgress()
{
strAppVersion = navigator.appVersion;
if (document.MyForm.FILE1.value != "" || document.MyForm.FILE2.value != "" || document.MyForm.FILE3.value != "")
{
if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
{
winstyle = "dialogWidth=385px; dialogHeight:140px; center:yes";
window.showModelessDialog('<% = barref %>&b=IE',null,winstyle);
}
else
{
window.open('<% = barref %>&b=NN','','width=375,height=115', true);
}
}
return true;
}
</SCRIPT>



can somone point me in the right direction on how i go about doing the 2?

thansk very much

MaD2ko0l<

© 1999-2010 MaD2ko0l

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 12 February 2009 :  20:17:49  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
no worries.. think i got it sorted now.

thanks anyway<

© 1999-2010 MaD2ko0l
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07