How to just get data back into the xml from a submit.
Posted: Thu Apr 20, 2006 7:01 pm
The example on the tutorial page for Server Side Dynamics shows a whole form being used. When it returns from that form, if you don't have a <goto> tag specified, the script exits. If you do have a <goto> tag, it appears to require that it be fully qualified. This means that you would have to go to another form when it returns.
Is there a way to have the the server side just output some JavaScript (ECMAScript) such that some variables will be set in the form that did the submit and the script continues at the location in the script right after the submit tag?
Current running form:
===============
<form id="some_form">
<var name="action">
<block>
<assign name="action" expr="'search'"\>
<submit next="getData.php" namelist="action" method="post"/>
<if cond="result==1>
<prompt>
Welcome <value ="first_name"\>
</prompt>
<else>
<prompt>
Sorry, could not find your record.
</prompt>
</if>
</block>
</form>
Server Side output:
==============
<?xml version=\"1.0\"?>
<script>
var first_name = 'John';
var last_name = 'Doe';
var result = 1;
</script>
Is there a way to have the the server side just output some JavaScript (ECMAScript) such that some variables will be set in the form that did the submit and the script continues at the location in the script right after the submit tag?
Current running form:
===============
<form id="some_form">
<var name="action">
<block>
<assign name="action" expr="'search'"\>
<submit next="getData.php" namelist="action" method="post"/>
<if cond="result==1>
<prompt>
Welcome <value ="first_name"\>
</prompt>
<else>
<prompt>
Sorry, could not find your record.
</prompt>
</if>
</block>
</form>
Server Side output:
==============
<?xml version=\"1.0\"?>
<script>
var first_name = 'John';
var last_name = 'Doe';
var result = 1;
</script>