/    Sign up×
Community /Pin to ProfileBookmark

Help needed asap

What’s wrong with this statement –
<a href=javascript:window.location.href=”http://domain.co.uk/?productID=<?=$productID?>&color=”+colorvalue()+’&prv’+prv();>Continue…</a>

It works if I get rid of the last +prv(), but as soon as I add it in it does nothing. Anyone knows how to deal with this?

Thanks!!!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonMay 30.2004 — My guess is that prv is actually a variable and not a function, in which case this should work:&lt;a href="http://domain.co.uk/?productID=&lt;?=$productID?&gt;" onclick="location.href=this.href+'&amp;amp;amp;color='+colorvalue()+'&amp;amp;amp;prv'+prv;return false;"&gt;Continue...&lt;/a&gt;If prv is a function then it may have an error in it or not return a value, in which case I'll need to take a look at it.

This link will also work for non-JavaScript enabled browsers but the URL will not have the color and prv added to it.
Copy linkTweet thisAlerts:
@zignauthorMay 30.2004 — [i]Originally posted by lavalamp [/i]

[B]My guess is that prv is actually a variable and not a function, in which case this should work:&lt;a href="http://domain.co.uk/?productID=&lt;?=$productID?&gt;" onclick="location.href=this.href+'&amp;amp;amp;color='+colorvalue()+'&amp;amp;amp;prv'+prv;return false;"&gt;Continue...&lt;/a&gt;If prv is a function then it may have an error in it or not return a value, in which case I'll need to take a look at it.

This link will also work for non-JavaScript enabled browsers but the URL will not have the color and prv added to it. [/B][/QUOTE]


Thanks!


My javascript:

<script language="javascript">



function colorvalue()

{

if (document.colorindex.colorID.value==0){

var flowercolor = 0;

}

else

{

for (var i=0; i < document.colorindex.colorID.length; i++)

{

if (document.colorindex.colorID[i].checked)

{

var flowercolor = document.colorindex.colorID[i].value;

}

}

}

return flowercolor;

}











function prv()

{

for (var j=0; j < document.pricerange.price.length; j++)

{

if (document.pricerange.price[j].checked)

{

var prvalue = document.pricerange.price[j].value;

}

}



return prvalue;

}



</script>





AND THE FORM ITSELF:



<form name="pricerange" method="post" action="">
<strong>PRICE RANGE:</strong>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="33%"><table width="100%" border="0" cellspacing="0">
<tr>
<td><input type="radio" id=price name=price value=1 checked></td>
<td>&pound;<?=$price1ID?></td>
</tr>
</table></td>
<?php
if($price2ID > 0){
print("<td width=33% align=right><table width=100% border=0 cellspacing=0><tr><td><input type=radio id=price name=price value=2></td><td>&pound;$price2ID</td></tr></table></td>");}

if($price3ID > 0){
print("<td width=33% align=right><table width=100% border=0 cellspacing=0><tr><td><input type=radio id=price name=price value=3></td><td>&pound;$price3ID</td></tr></table></td>");}
?>
</tr>
</table>
</form>
Copy linkTweet thisAlerts:
@David_HarrisonMay 30.2004 — Do you have a page with this on so I can see the thing as a whole?
×

Success!

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