However, when I submit the form, only the values of the static fields are sent back. The controls which were added dynamically via CGI::Ajax seem to be ignored. Further details:
Selecting, say, a "Wait" order causes CGI::Ajax to send back the text<tr><form name=orderform action=crystomere.cgi method=get> <td></td> <td colspan=3> <input type=hidden name=action value=issueorder> <input type=hidden name=id id=unitid value=1891233> <select name=ordertype id=ordertype size=1 style="width:100%" On +MouseUp="order_params(['ordertype', 'unitid'], ['orderparams']);"> <option value=halt>Halt <option value=attack>Attack <option value=capture>Capture <option value=move>Move <option value=rest>Rest <option value=wait>Wait </select> <div id=orderparams></div> </td> <td style="vertical-align:bottom"><input type=submit value='Issue +Order'></td> </form></tr>
(which is inserted into the "orderparams" div) but a "submit" then GETs crystomere.cgi?action=issueorder&id=1891233&ordertype=wait - action, id, and ordertype are there, but duration is nowhere to be found.<table width=100% border=0> <tr><th width=10%>Duration</th><td><input type=text name=duration styl +e="width:100%"></td></tr> </table>
The Firefox DOM inspector shows that the new field is present, it is within the form tags, and it is named as expected. On the advice of a Java junkie friend, I tried changing the submit control to a plain button which did a JavaScript alert showing the value of the CGI::Ajax-added control, then using JS to perform the actual submit; the alert displayed the correct value, but the value was still not sent back to the server.
In reply to Submitting forms with CGI::Ajax-created fields by dsheroh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |