Re: Conditional anchor href value

From: Date: Wed, 03 Dec 2003 04:37:31 +0000
Subject: Re: Conditional anchor href value
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-171646@lists.php.net to get a copy of this message
Martin Towell wrote: > you might be able to put the id of the next/prev card as the value of the > <option> > and then use javascript to generate the url. > > the only reliance then would be that the browser as JS enabled, as the above > should be possible with the most basic of JS That's not all that different from what I'm doing. The following gets called from the left arrow graphic: function getLinkLeft(form) { var prevDate= <?php echo "\"$prevDate\""; ?>; var prevSrce= <?php echo "\"$prevSrce\""; ?>; if (form.setarrows.value == "date") { location=prevDate; } else { location=prevResults; } } ... <a href="javascript:getLinkLeft(self)"><img src="arrow.gif"></a> I know next-to-no javascript, so this has all been cobbled together via an afternoon's research. It appears to be what _should_ work, but it only behaves in one browser out of six I've tried (Safari). I'd just as soon ditch the JS, since I don't want to rely on it being enabled for this site. I just can't think of a server-side approach. -e

« previous php.general (#171646) next »