Once again, more generally to what happens here.
The FOR EACH expression
just writes back HTML CODE --> <option value=".... to built the [form] page [usually --> $content["all"] what in this file is done by --> $cnt_form ]
AS LONG
as all option values are processed.
At the end of this [FOR EACH] there is an HTML selection box back in the page.
The problem now is, that there is no operation like:
Opps --> Selection Box --> Yes --> this is selected --> remember the value or write it where else...
[you know what i mean??]
At this point the values play no role but just stay untouched to wrap HTML code around.
There is one case we could --> identify the selected option value !!??
In that case the selection box contains ' selected' [THIS WOULD BE EXACT THE $option_value WE NEED] it gets cut off and then added right back to the HTML construction/expression.
Code: Select all
} else {
$option_value = str_replace(' selected', '', $option_value);
$form_field .= '<option value="'.$option_value.'" selected="selected"';
Another suggestion, worth to be tested, could perhaps be to add $MySubject = $option_value; right below:
Code: Select all
} else {
$option_value = str_replace(' selected', '', $option_value);
$form_field .= '<option value="'.$option_value.'" selected="selected"';
$MySubject = $option_value;
BUT KEEP IN MIND:
this routine operates all forms and all option/select boxes!!!
So, what we need is an expression that just writes option_value to your additional variable [at the RIGHT moment].
I do NOT know, where to find or how to --> catch !!??
Something like:
IF
$POST_val[$POST_name] IS MY_SELECTION BOX [id]
get the selected value AND write into MY_VARiable