/    Sign up×
Community /Pin to ProfileBookmark

How Do I Combine Two Scripts?

Hi,

I’ve asked this question earlier but didn’t get a response. I need to combine two scripts (I can’t seem to find one that does both things the way I need it done).

<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
function checkEmail(myForm) {
if (/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/.test(myForm.email.value)){
return (true)
}
alert(“Invalid E-mail Address! Please re-enter.”)
return (false)
}
// End –>
</script>
<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)==”required”) {
if (((tempobj.type==”text”||tempobj.type==”textarea”)&&
tempobj.value==”)||(tempobj.type.toString().charAt(0)==”s”&&
tempobj.selectedIndex==0)) {
pass=false;
break;
}
}
}
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert(“Please make sure the “+shortFieldName+” field was properly completed.”);
return false;
}
else
return true;
}
// End –>
</script>

Any ideas?

I have tried…but failed.

Thanks in advance.

Riz

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @riz-man spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...