|
Posted by Kimmo Laine on 07/24/06 12:02
"Simon Rigby" <google@simonrigby.co.uk> wrote in message
news:1153741502.516370.84080@h48g2000cwc.googlegroups.com...
> Hello folks,
>
> Ive seen lots of recommendations to not try to do what Im trying to do
> but let me put it this way and hopefully someone can tell if this is a
> good idea or not (or an alternative).
>
> What Im trying to do is this. I have a series of links that when
> clicked will navigate to a common page passing in a value encoded in
> the link. For reasons not worth going into I cant use a querystring.
>
> I was hoping to call a javascript function from the onclick event of
> the link, then assign a new $_POST variable and then submit the form
> (hence enabling me to read the $_POST value from the receiving page.
So in other words, you'd like to post a form on the click of a link, and
submit a certain value, if I understood your explanation. What would you say
of the following "workaround": change your <a href> to a form:
<form action="reciever.php" class="pseudolink" method="POST">
<input type="submit"/>
<input type="hidden" name="var" value="val"/>
</form>
and attatch a stylesheet that'll camouflage your form into a harmless
looking link:
<style type="text/css">
..pseudolink {
display:inline;
}
..pseudolink input {
display:inline;
border:none;
backgroundcolor:one;
text-decoration:underline;
cursor:pointer;
color:blue;
}
</style>
I'm just one of the people who wish to avoid javascript whenever it is
possible. I think there's a chance here to do so with the code above. Of
course there will be n+1 forms on the page, I dunno if that's nice then...
Call this the alternative then if you will.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|