/    Sign up×
Community /Pin to ProfileBookmark

Mulitiple var

What I am trying to do is show is the 1st docwrite (below) if date is <= than the deadline (yyyy-mm-dd) and then if “CartFile” = Cancled, another cancelation opage telling customer what to do.

Obviously this don’t work, can someone point me in the right direction or
a sample bit of code that does something similar. I would really appreciate any help I can get here. (text enclosed in [[ ]] is template data from a flat file database.)

<script>
var name = “[[Deadline2]]”
var name2= “[[CartFile]]”

name=name.split(/D/); if (new Date(name[0],name[1]-1,name[2])<= new Date())
{
{
document.write(“<tr><td><a
href=’http://www.375fss.com/cgi-bin/ClassSignUp0A.pl?ID=[[ID]]&StartDate=[[S
tartDate]
]’ && onClick=’LinkAlert()’>[[Title]]</a> </td>”)
}
else if {
document.write(“<tr><td><a
href=’http://www.375fss.com/cgi-bin/ClassSignUp0B.pl?ID=[[ID]]&StartDate=[[S
tartDate]
]’ && onClick=’LinkAlert()’>[[Title]]</a> </td>”)
}
name2= “Canceled”
else if name2= “Canceled” {
document.write(“<tr><td><a
href=’http://www.375fss.com/cgi-bin/ClassSignUp0C.pl?ID=[[ID]]&StartDate=[[S
tartDate]
]’ && onClick=’LinkAlert()’>[[Title]]</a> </td>”)
}
</script>

</tr>

Thanks,

Tom Rector

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@maurycyMar 08.2011 — [CODE]<script>
var name = "[[Deadline2]]"
var name2= "[[CartFile]]"
name=name.split(/D/);
if (new Date(name[0],name[1]-1,name[2])<= new Date()){
document.write("<tr><td><a href='http://www.375fss.com/cgi-bin/ClassSignUp0A.pl?ID=[[ID]]&StartDate=[[StartDate]]' && onClick='LinkAlert()'>[[Titlse]]</a> </td>")
}else if(name2 == "Canceled"){
document.write("<tr><td><a href='http://www.375fss.com/cgi-bin/ClassSignUp0B.pl?ID=[[ID]]&StartDate=[[StartDate]]' && onClick='LinkAlert()'>[[Titlee]]</a> </td>")
}else if(name2 != "Canceled"){
document.write("<tr><td><a href='http://www.375fss.com/cgi-bin/ClassSignUp0C.pl?ID=[[ID]]&StartDate=[[StartDate]]' && onClick='LinkAlert()'>[[Titrle]]</a> </td>")
}
</script> [/CODE]


Check it again, and pls use CODE tag on forum
Copy linkTweet thisAlerts:
@iamiauthorMar 08.2011 — Thank you worked like a charm !!

I am posting another question:

working in another script mod...

//-----10% Off Coupon-----

if (coupon=="N110"){

form.PRICE.value=-(moneyFormat(fTotal * .10)-1);

form.ID_NUM.value="N110";

form.NAME.value=" Craft Month Promo 10% Off";

location.href=location.href;

return true;

}

I want to replace the .10 with an external peice of data, so users can change the amount with having to open the script. Sorta like those early marquees' where the marquee text was inserted from a text file.
×

Success!

Help @iami 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,
)...