tbirnseth
09-24-2005, 01:06 AM
Hi all,
A couple of questions. When a <select> is SELECTED, shouldn't the form send the selected value even if the selection wasn't changed? I.e. this code segment
does not always return the SELECTED option. I've been pulling my hair out tryiing to figure it out.
2nd point - anyone else run into the FireFox bug where if "SELECTED" is not immediately adjacent to the ending quote of the value it is not always picked up? I've seen this one too.
<select name="pType[Debug]" id="pType[Debug]" >
<option value="1"> string </option>
<option value="2"SELECTED > bool </option>
<option value="3"> int </option>
<option value="4"> path </option>
<option value="5"> prompt </option>
</select>
Segment of the form processing is:
foreach($updateList as $param) {
$pName[$param] = isset($_POST['pName'][$param]) ? $_POST['pName'][$param] : '';
$pType[$param] = isset($_POST['pType'][$param]) ? intval($_POST['pType'][$param]) : 0;
if( $pType[$param] == 0 )
TBdebug(sprintf("POST[pTYPE][%s} is NOT set!!!", $param));
The debug statement is executed for some (but not all) of the 'pType' POSTS.
I'm stumped and figure that I've probably been doing something wrong for a long time and have stumbled across it now that I'm using arrays for holding the records.
Any help is greatly appreciated.
tony
A couple of questions. When a <select> is SELECTED, shouldn't the form send the selected value even if the selection wasn't changed? I.e. this code segment
does not always return the SELECTED option. I've been pulling my hair out tryiing to figure it out.
2nd point - anyone else run into the FireFox bug where if "SELECTED" is not immediately adjacent to the ending quote of the value it is not always picked up? I've seen this one too.
<select name="pType[Debug]" id="pType[Debug]" >
<option value="1"> string </option>
<option value="2"SELECTED > bool </option>
<option value="3"> int </option>
<option value="4"> path </option>
<option value="5"> prompt </option>
</select>
Segment of the form processing is:
foreach($updateList as $param) {
$pName[$param] = isset($_POST['pName'][$param]) ? $_POST['pName'][$param] : '';
$pType[$param] = isset($_POST['pType'][$param]) ? intval($_POST['pType'][$param]) : 0;
if( $pType[$param] == 0 )
TBdebug(sprintf("POST[pTYPE][%s} is NOT set!!!", $param));
The debug statement is executed for some (but not all) of the 'pType' POSTS.
I'm stumped and figure that I've probably been doing something wrong for a long time and have stumbled across it now that I'm using arrays for holding the records.
Any help is greatly appreciated.
tony