Click to See Complete Forum and Search --> : Submitting form variables without using a form, PLEASE I NEED HELP


uniflare
03-13-2003, 12:50 AM
I really dont have a clue how to start explaining this but ill try after i give you the code i want to work, see if you can understand me:


<script>
function goto_link($game, $page)
{
var game = (game);
var page = (page);
document.submit();
}
</script>
<a href='javascript:goto_link("warcraft3", "news")'>Link to the next form</a>


I want to uhh... click the link, and by clicking the link send the values of the variables i sent to check.html

So i want to send the variables "game" and "page" to a page called check.html so i can treat them as if they were sent in a form.

i dont want to have to write a form for each link(about 20-30 links) on my menu, so i really do need this, so i can make the page a small as i can. Im doing this so the browser doesn't cache my pages, so you cant view them by "Working Offiline". I HAVE tried meta tags using cache-control but they dont work, PLEASE help me....

PS: I can use PHP if you want to give me a script in PHP that stops you viewing pages "Offline"...

Thanks... :D

Nedals
03-13-2003, 01:05 AM
Cannot be done! You must use a form.
I suggest you use hidden fields (one or more) and load all your data (delimited with '|' maybe) into a hidden field. Post that and unscramble the data on the server.

There again...
You could put the data into a query_string (url?query_string) but it's pretty messy with a lot of data and I know the amount of data permissable is limited. (not highly recomended!)

uniflare
03-13-2003, 01:57 AM
well, thanks for telling me :D

Vladdy
03-13-2003, 06:00 AM
Query sting is messy??? It's other way around!!! How many lines of code will it take you to do this with forms, huh?
function gotoLink(option1,option2)
{ window.location = 'check.html?Option1='+option1+'&Option2='option2;
}