c q
08-09-2002, 04:29 PM
<?php
session_start();
?>
<?php
if ( ! isset ( $txtSize ) )
{
session_register( "txtSize" );
$txtSize = "1";
}
?>
<script language=javascript>
function invoke(size){
document.forms[0].value = size;
document.location.reload();
}
</script>
<span class=white1>
<form method="POST" action="<?php print $PHP_SELF?>">
<input type=hidden name=txtSize value="1">
<select NAME="opt" class="grey1" onChange="invoke(this.selectedIndex);" target="_self">
<OPTION>Change Text Size</option>
<OPTION VALUE="small">Small (default)</option>
<OPTION VALUE="medium">Medium</option>
<OPTION VALUE="large">Large</option>
</select>
</form>
</span>
<?php
print $txtSize;
?>
I tought this shud work fine..but it isn't. Well, what I basically want is something that'll allow the user to choose the desired choice so I can store it in the session variable $txtSize and also refresh the current page, all this as soon as the state of the select box changes. Maybe javascript is not the correct way to do it...becoz when I run this script, it simply reloads the page without changing the value of the session variable $txtSize.
Help anyone ?????
c q
session_start();
?>
<?php
if ( ! isset ( $txtSize ) )
{
session_register( "txtSize" );
$txtSize = "1";
}
?>
<script language=javascript>
function invoke(size){
document.forms[0].value = size;
document.location.reload();
}
</script>
<span class=white1>
<form method="POST" action="<?php print $PHP_SELF?>">
<input type=hidden name=txtSize value="1">
<select NAME="opt" class="grey1" onChange="invoke(this.selectedIndex);" target="_self">
<OPTION>Change Text Size</option>
<OPTION VALUE="small">Small (default)</option>
<OPTION VALUE="medium">Medium</option>
<OPTION VALUE="large">Large</option>
</select>
</form>
</span>
<?php
print $txtSize;
?>
I tought this shud work fine..but it isn't. Well, what I basically want is something that'll allow the user to choose the desired choice so I can store it in the session variable $txtSize and also refresh the current page, all this as soon as the state of the select box changes. Maybe javascript is not the correct way to do it...becoz when I run this script, it simply reloads the page without changing the value of the session variable $txtSize.
Help anyone ?????
c q