I'm trying to use cfajax method to show the user selection (successful) and save user selection in a defined structure without reload the page (failed). Any advice? Thanks!
Here is example: I would like to know how I can save the "county" selection in a defined structure whthout submit?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>CFajax - Loading list</title>
<script type='text/javascript' src="../core/engine.js"></
script>
<script type='text/javascript' src='../core/util.js'></sc
ript>
<script type='text/javascript' src='../core/settings.js'>
</script>
<script language="javascript">
function getCounty()
{
var state = DWRUtil.getValue("state");
DWREngine._execute(_cfscri
ptLocation
, null, 'countylookup', state, getCountyResult);
}
function getCountyResult(countyArra
y)
{
DWRUtil.removeAllOptions("
county");
DWRUtil.addOptions("county
", countyArray);
}
function init()
{
DWRUtil.useLoadingMessage(
);
DWREngine._errorHandler = errorHandler;
getCounty();
}
</script>
</head>
<body onLoad="init()">
<h1>Dynamically Populating a List</h1>
<table>
<tr>
<td colspan="2">Example</td>
</tr>
<tr>
<td>
Select a State :
</td>
<td>
<select id="state" id="state" name="state" onChange="getCounty()">
<option value="VA">Virginia</optio
n>
<option value="GA">Georgia</option
>
<option value="CA">California</opt
ion>
</select>
</td>
</tr>
<tr>
<td>
Select a County :
</td>
<td>
<select name="county" id="county" style="vertical-align:top;
"></select
>
</td>
</tr>
</table>
</body>
</html>
Start Free Trial