Click to See Complete Forum and Search --> : Script loading a variable?


muratisik
11-24-2003, 04:45 AM
Hello,
I am new to javascript and I was looking for a javascript code that does what this simple html line does:

<INPUT TYPE=SUBMIT NAME="refreshpage" VALUE="Refresh">

without placing a button on the page. It is like when this script is somehow triggered it should load value Refresh to variable refreshpage in html formats (so that it can be used in HTTP_POST_VARS["refreshpage"] in php) and refresh the page.

I am planning to use this code over frames and have it triggered from another frame by a script that has button and when clicked triggers another script in another frame (this one naturally )

Can anyone give me such an example script?

gil davis
11-24-2003, 07:46 AM
window.top.frameName.location.reload()

muratisik
11-24-2003, 09:42 AM
I dont know much about javascript but I guess that only refreshes the target frame, it does nothing about any variables...
Maybe my example was confusing. It is not supposed to be refreshing anyway. Lets's say there is a button INCREMENT.

<INPUT TYPE=SUBMIT NAME="incrementnumber" VALUE="INCREMENT">

When pressed it refreshes the page and since isset(HTTP_POST_VARS["incrementnumber"]) is true it increments a variable by one.

<?php

$var=6;
if(isset(HTTP_POST_VARS["incrementnumber"]))
{
++$var;
}
?>
<INPUT TYPE=SUBMIT NAME="incrementnumber" VALUE="INCREMENT">

Something like this...
Any way to do this by javascript?