Advertisement

03.31.2008 at 09:09AM PDT, ID: 23282994 | Points: 500
[x]
Attachment Details

how to convert javascript value to cfml value?

Asked by FIATECH in Cold Fusion Markup Language, JScript

Tags: coldfusion, cfajax, IE

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'></script>
            <script type='text/javascript' src='../core/settings.js'></script>
            <script language="javascript">
                  function getCounty()
                  {
                        var state = DWRUtil.getValue("state");
                        DWREngine._execute(_cfscriptLocation, null, 'countylookup', state, getCountyResult);
                  }
                  
                  function getCountyResult(countyArray)
                  {
                        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</option>
                                    <option value="GA">Georgia</option>
                                    <option value="CA">California</option>
                              </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
[+][-]04.02.2008 at 10:45AM PDT, ID: 21265480

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 09:28AM PDT, ID: 21274269

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628