i got this code on file.php
[code=php]
$PercentSelect = ‘<tr><td class=”grey” align=”left”>’.translation(‘INPUT_TYPE’,$language_code, $connection).’:</td><td class=”grey” align=”left” width=70%>’;
$PercentSelect .= ‘<select name=”Percent” onChange=setValues2(‘1′);setFromPercent(”.$Percent.”);submit()>’;
if ($Percent == ‘MONEY’){
if($action2 == 1){
$fill=($yearly_budget/$last_periods_selected);
$data = ‘<input type=”text” maxlength=”255″ name=”‘.$name.$i.'” size=”‘.$size.'” value=”‘.$fill.'”>’.$unit.”.$errorvalue.”;
}
else{
$data = ‘<input type=”text” maxlength=”255″ name=”‘.$name.$i.'” size=”‘.$size.'” value=”‘.$fill.'”>’.$unit.”.$errorvalue.”;
}
}
if ($Percent == ‘AUTOMATIC’){
if($action2 == 1){
$fill=(100/$last_periods_selected);
$data = ‘<input type=”text” maxlength=”255″ name=”‘.$name.$i.'” size=”‘.$size.'” value=”‘.substr($fill,0,4).'”>%’;
}
else{
$data = ‘<input type=”text” maxlength=”255″ name=”‘.$name.$i.'” size=”‘.$size.'” value=”‘.$fill.'”>’.$unit.”.$errorvalue.”;
}
}
if ($Percent == ‘PERCENT’){
if($action2 == 1){
$fill=(100/$last_periods_selected);
$data = ‘<input type=”text” maxlength=”255″ name=”‘.$name.$i.'” size=”‘.$size.'” value=”‘.substr($fill,0,4).'”>%’;
}
else{
$data = ‘<input type=”text” maxlength=”255″ name=”‘.$name.$i.'” size=”‘.$size.'” value=”‘.$fill.'”>’.$unit.”.$errorvalue.”;
}
}
$save_button = “<input type=”submit” name=”knop” value=”save” onClick=”setValues( ‘1’ );” class=”formbutton”>”;
it will display some textbox and the value is $fill
if i dont change the dropdown (from percent to money or vice versa) the $action2 == 0
if i press the save button (with changing the dropdown), it’ll automatically fill in the text box with $fill value
but if i press the 2nd time (without changing the dropdown), how to make the text box still have the $fill value?