Cfselect bond to a cfinput

I have a cfselect that is bound to a cfinput. It work great
expect that the
cfselect does not update until the cfinput loses focus. Is
there any way to
get the cfselect to update while you are typing in the
cfinput? Code below.
************ cfm file ***************
<cfinput type="text" name="schname" message="Please enter
your School Name"
required="yes" id="schname" value="Please Type Your School
Name" size="20"
maxlength="30" />
<cfselect enabled="No" name="School" multiple="no"
value="School" display="School"
bind="cfc:lookups.getschool({schname})"
></cfselect>
***************** cfc file *****************
<cfcomponent>
<cffunction name="getschool" access="remote">
<cfargument name="schname" required="yes">
<cfquery name="findschool" datasource="#client.dsn#">
SELECT School
FROM schools
where School like '#schname#%'
</cfquery>
<cfif findschool.recordcount is 0>
<cfscript>
queryAddRow(findschool);
querySetCell(findschool,'School','No Schools by that Name');
</cfscript>
</cfif>
<cfreturn findschool>
</cffunction>
</cfcomponent>

Figured it out.You have to change the bind statement see
below. see the
@keyup
<cfselect enabled="No" name="School" multiple="no"
value="School" display="School"
bind="cfc:lookups.getschool({schname@keyup})"></cfselect>
"Rick" <[email protected]> wrote in message
news:fo2d0u$brg$[email protected]..
>I have a cfselect that is bound to a cfinput. It work
great expect that the
>cfselect does not update until the cfinput loses focus.
Is there any way to
>get the cfselect to update while you are typing in the
cfinput? Code below.
>
> ************ cfm file ***************
>
> <cfinput type="text" name="schname" message="Please
enter your School
> Name" required="yes" id="schname" value="Please Type
Your School Name"
> size="20" maxlength="30" />
> <cfselect enabled="No" name="School" multiple="no"
> value="School" display="School"
bind="cfc:lookups.getschool({schname})"
> ></cfselect>
>
>
> ***************** cfc file *****************
> <cfcomponent>
>
> <cffunction name="getschool" access="remote">
> <cfargument name="schname" required="yes">
>
> <cfquery name="findschool"
datasource="#client.dsn#">
> SELECT School
> FROM schools
> where School like '#schname#%'
> </cfquery>
>
> <cfif findschool.recordcount is 0>
> <cfscript>
> queryAddRow(findschool);
> querySetCell(findschool,'School','No Schools by that
Name');
> </cfscript>
> </cfif>
> <cfreturn findschool>
> </cffunction>
> </cfcomponent>
>
>
>

Similar Messages

  • Bind in form works with cfinput, how to with cfselect and a href

    Hi all
    This code workks binding a cfinput in an HTML cfform:
    Name:<cfinput type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" >
    However this href doesn't seem to bind correctly:
    <a  href="http://www.google.com/search?hl=en&output=search&sclient=psy-ab&q={UsersGrid.COMPANY}&btnK=" bind="{UsersGrid.COMPANY}">Google.com</a>
    This cfselect doesn't either:
    Department: <cfselect name="DEPARTMENT1" width="100" size="1" label="Department" required="yes" bind="UsersGrid.DEPARTMENT1">
    <option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput>
    </cfselect> 
    How can I make them both work? Thank you

    Sure, Aaaron here it is, it uses the same database tables and datasource as in the other thread:
    <cfquery name="QNAMES" datasource="tester">
        select * from company, industries, division
    where company.SECTORS1 = industries.SECTORSIDS
    <cfif structKeyExists(url,"sectorid")>
    and industries.SECTORSIDS = #url.sectorid#</cfif>
    and division.DEPARTMENTIDS = company.DEPARTMENT1
    and company.WHEN = 2
    ORDER BY company</cfquery>
    <cfquery name="dNames" datasource="tester">
        select DEPARTMENTIDS, DEPARTMENTNOM
        from division
    order by DEPARTMENTNOM</cfquery>
    <CFQUERY name="industries" datasource="tester">
    SELECT * FROM industries
    </CFQUERY>
    <CFQUERY name="salesstep" datasource="tester">
    SELECT * FROM sales
    </CFQUERY>
    <CFQUERY name="xity" datasource="tester">
    SELECT * FROM ciudad
    </CFQUERY>
    <CFQUERY name="hols" datasource="tester">
    SELECT * FROM holidays
    </CFQUERY>
    <!--- UPDATE QUERY --->
    <cfif isDefined("FORM.UPDATEADDBTN")>
    <cfif FORM.ENTID GTE 1>
    <cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
    <cfset isSECTORS1Null = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
    <cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
    <cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
    <cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
    <cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
    <cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
    <cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
    <cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
    <cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
    <cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
    <cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
    <cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
    <cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
    <!--- DATECFM--->
    <cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
    <cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
    <CFQUERY name="updatecompany" datasource="tester">
    update COMPANY
    SET COMPANY = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
       SECTORS1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
       RANKING = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
       PRICE = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
       DEPARTMENT1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
       FIRSTNAME = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
       POS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
       PHONE = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
       EMAIL = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
       MOBILE= <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
       ADDRESS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
       CITY = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
       COMMENTS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
       ABUNDANCE = <cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
       MTGT = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
       STATE1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
    WHERE ENTID = #FORM.ENTID#
    </CFQUERY>
    <CFLOCATION URL="testht.cfm?begin=1">
    <cfelse>
    <cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
    <cfset isSECTORS1Null   = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
    <cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
    <cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
    <cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
    <cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
    <cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
    <cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
    <cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
    <cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
    <cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
    <cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
    <cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
    <cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
    <cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
    <cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
    <!--- DATECFM --->
    <!--- ADD COMPANY QUERY --->
    <CFQUERY name="addcompany" datasource="tester">
    INSERT INTO COMPANY(
    COMPANY,
    SECTORS1,
    RANKING,
    PRICE,
    DEPARTMENT1,
    FIRSTNAME,
    POS,
    PHONE,
    EMAIL,
    MOBILE,
    ADDRESS,
    CITY,
    COMMENTS,
    ABUNDANCE,
    MTGT,
    STATE1
    VALUES (
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
    </CFQUERY>
    <!---DATE_FORMAT(datetime_field_name,'%Y-%m-%d');--->
    <CFLOCATION URL="testht.cfm?begin=1">
    </cfif>
    </cfif>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Sales</title> 
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="formst.css" type="text/css" media="screen" />
    </head>
    <cfdump var=#qnames#>
    <cfajaxproxy bind="javascript:myHandler({UsersGrid.COMPANY},{UsersGrid.SECTORS1},{UsersGrid.DEPARTMENT 1})"/>
    <script type="text/javascript">
      function myHandler(COMPANY,SECTORS1,DEPARTMENT1) {
          //update the link's href
          document.getElementById('myLink').href = 'http://www.google.com/search?q=' + COMPANY;
          document.getElementById('Linkedin').href = 'http://www.google.com/search?q=linkedin' + COMPANY;
          //update SECTORS1's selected
          var theField = document.getElementById('SECTORS1');
          for(var i=0; i<theField.options.length; i++) {
              if(theField.options[i].value==SECTORS1) {
                  theField.options[i].selected = true;
              } else {
                  theField.options[i].selected = false;
    </script>
    <!--- TOP --->
    <body>
    <div>
    <cfform name="SFORM" FORMAT="html"  width="1000" height="400" style="margin-left:140px;">
    <cfgrid name="UsersGrid"
               FORMAT="html"
               query="QNAMES" width="920" height="200" rowheaders="No" striperows="yes" striperowcolor="fefefe">
    <cfgridcolumn name="RANKING" width="40"header="Rank">
    <cfgridcolumn name="COMPANY" width="170" header="Company">
    <cfgridcolumn name="FIRSTNAME"  header="Contact Name">
    <cfgridcolumn name="POS" width="160" header="Position">
    <cfgridcolumn name="DEPARTMENTNOM" width="150" header="Department">
    <cfgridcolumn name="SECTORSNOM" width="120" header="Sectors">
    <cfgridcolumn name="ABUNDANCE" width="120" header="Action date">
    <cfgridcolumn name="SECTORS1" width="120" header="Action date" display="no">
    <cfgridcolumn name="PRICE" width="120" header="Action date" display="no">
    <cfgridcolumn name="PHONE" width="120" header="Action date" display="no">
    <cfgridcolumn name="EMAIL" width="120" header="Action date" display="no">
    <cfgridcolumn name="MOBILE" width="120" header="Action date" display="no">
    <cfgridcolumn name="ADDRESS" width="120" header="Action date" display="no">
    <cfgridcolumn name="CITY" width="120" header="Action date" display="no">
    <cfgridcolumn name="COMMENTS" width="120" header="Action date" display="no">
    <cfgridcolumn name="MTGT" width="120" header="Action date" display="no">
       </cfgrid>
    <!---FIRST--->
    <table width="880" class="stat" >
    <tr><td><cfoutput>#QNAMES.RecordCount# Companies</cfoutput></td></tr>
    <tr>
    <td>Company:<cfinput class="input" type="text" name="COMPANY" size="20" label="Company" required="yes"  bind="{UsersGrid.COMPANY}" ></td>
    <td>
    Sector:<cfselect class="input" name="SECTORS1" size="1" label="Sector" required="yes">
    <option></option><cfoutput query="industries"><option value="#SECTORSIDS#">#SECTORSNOM#</option></cfoutput></cfselect>
    </td>
    <td>Ranking:<cfinput class="input"  type="TEXT" name="RANKING" size="3" label="Ranking" bind="{UsersGrid.RANKING}" ></td>
    <td>Price:<cfinput class="input" type="TEXT" name="PRICE" size="3" label="Price" bind="{UsersGrid.PRICE}" >
    <a href="" id="myLink" target="_blank">Google</a>
    <a href="" id="Linkedin" target="_blank">Linkedin</a></td>
    </tr>
    <tr>
    <td>Department:<cfselect class="input" name="DEPARTMENT1" size="1" label="Department" required="yes">
    <option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput></cfselect>
    </td>
    <td>Name:<cfinput class="input" type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" ></td>
    <td>Position:<cfinput class="input" type="text" name="POS" label="Position" width="150" bind="{UsersGrid.POS}" ></td>
    <td>Phone:<cfinput class="input" type="text" name="PHONE" label="Phone" width="150" bind="{UsersGrid.PHONE}" ></td>
    </tr>
    <!--- THIRD--->
    <tr><td>Email:<cfinput class="input" type="text" name="EMAIL" label="Email" width="150" bind="{UsersGrid.EMAIL}" ></td>
    <td>Mobile:<cfinput class="input" type="text" name="MOBILE" label="Mobile"  bind="{UsersGrid.MOBILE}" ></td>
    <td>Address:<cfinput class="input" type="text" name="ADDRESS" label="Address"  bind="{UsersGrid.ADDRESS}" ></td>
    <td><cfselect class="input" name="CITY" width="80" size="1" >
    <cfoutput query="xity"><option value="#CITYID#">#CITYNOM#</option></cfoutput>
    </cfselect></td>
    </tr> 
    <!--- FOURTH --->
    <tr><td>Comments:<cftextarea class="input" name="COMMENTS" height="60"  label="Comments" bind="{UsersGrid.COMMENTS}" /> </td>
    <td>Action:<cfinput type="DateField" class="input" size="10" name="ABUNDANCE" label="Action"  bind="{UsersGrid.ABUNDANCE}" ></td>
    <td>Time:<cfselect class="input" name="MTGT" width="90" label="Time"><option>7:00AM</option></cfselect></td>
    <td><cfselect class="input" name="STATE1"  size="1" label="Action" >
    <cfoutput query="salesstep"><option value="#SALESID#">#SALESNOM#</option></cfoutput>
    </cfselect>  </td>
    <cfinput type="hidden" name="ENTID" label="ENTID" bind="{UsersGrid.ENTID}" >
    </tr>
    <tr> <td> 
    <cfinput type="submit" name="DELCOM" value="delete" class="button" >
    <cfinput type="submit" name="UPDATEADDBTN" value="UPDATE or ADD NEW" class="button"></td>
    </tr>
    </table>
    </cfform>
    <cfif isDefined("FORM.DELCOM")>
    <CFQUERY name="deletecompany" datasource="tester">
    DELETE FROM COMPANY
    WHERE ENTID = #FORM.ENTID#
    </CFQUERY>
    <CFLOCATION URL="testht.cfm">
    </cfif>
    </div>
    </body>
    </html>

  • Another CFInput and CFC Binding question.

    I have been away from CF since version 5.  Now, I have a need to start back up
    on CF, but at version 9.  I am kind of liking these cfc's.
    Here is what I am having trouble with:
    I have a cfform(html) that has a handful of elements in it.  The first element is a cfselect which is bound to cfc.getClientList(Done this way to allow the drop down to be reusable).  This piece of the puzzle works just fine.  What I am trying to do from this is when a user selects a client from the dropdown, the remaining five elements are bound to another function called getClientDetail which has a returntype of query.  I want to be able to bind the 5 columns returned in my query to the 5 cfinputs below my cfselect.  Any thoughts on this would be helpful as I have tried almost everything I can think of to make this work.

    Copy the following 2 files into the same directory under your web root. The comments are self-explanatory.
    selectEmployee.cfm
    <!--- The cfajaxproxy tag creates a client-side proxy for the Employee CFC.
            View the generated page source to see the resulting JavaScript. 
            The Employee CFC is in the same directory as this page. --->
    <cfajaxproxy cfc="Employee" jsclassname="emp">
    <html>
        <head>
            <script type="text/javascript">
                /* Asynchronous call to get the employee details.
                   The function is called when the user selects an employee. */
                    var getEmployeeDetails = function(id){
                    var e = new emp();
                    e.setCallbackHandler(populateEmployeeDetails);
                    e.setErrorHandler(myErrorHandler);
                /* Pass the employee name to the getEmployees CFC function. */
                    e.getEmployeeDetails(id);
                /* Callback function: sets the results of getEmployeeDetails into input fields */
                var populateEmployeeDetails = function(employee)
                    var first_name = employee.DATA[0][0];
                    var email_name = employee.DATA[0][1];
                    var department = employee.DATA[0][2];
                    var phone      = employee.DATA[0][3];
                    var location   = employee.DATA[0][4];
                    document.empForm.fname.value = first_name;
                    document.empForm.email.value = email_name;
                    document.empForm.dept.value = department;
                    document.empForm.tel.value = phone;
                    document.empForm.loc.value = location;          
                /* Error handler */
                var myErrorHandler = function(statusCode, statusMsg)
                    /* blank the field entries*/
                    document.empForm.fname.value = '';
                    document.empForm.email.value = '';
                    document.empForm.dept.value = '';
                    document.empForm.tel.value = '';
                    document.empForm.loc.value = '';
                    alert('Status: ' + statusCode + '. ' + statusMsg);
            </script>
    </head>
    <body>
    <cfform name="empForm">
    Employee: <cfselect  value="emp_id" display="name" name="employee" bind="cfc:Employee.getEmployee()" bindonload="true" onChange="getEmployeeDetails(this.value)">
    </cfselect><br>
    First name: <cfinput name="fname"><br>
    E-mail name: <cfinput name="email"><br>
    Department: <cfinput name="dept"><br>
    Telephone: <cfinput name="tel"><br>
    Location: <cfinput name="loc"><br>
    <cfinput name="sbmt" type="submit" value="send" onclick="if(employee.value==''){alert('You must select an employee');return false;}">
    </cfform>
    </body>
    </html>
    Employee.cfc
    <cfcomponent output="false">
    <cffunction name="getEmployee" access="remote" output="false" returntype="any">
    <cfset var getAllEmployees = queryNew("","")>
    <cfset var arr = arrayNew(2)>
    <cfquery name = "getAllEmployees" dataSource = "cfdocexamples">
        SELECT Emp_ID,  FirstName || ' ' || LastName as Name
        FROM Employees
    </cfquery>
    <cfset arr[1][1]="">
    <cfset arr[1][2]="Select employee">
    <cfloop query="GetAllEmployees">
    <cfset arr[currentrow+1][1]=emp_id>
    <cfset arr[currentrow+1][2]=name>
    </cfloop>
    <!--- Alternative, if you require no "Select employee" option --->
    <!--- <cfloop query="GetAllEmployees">
    <cfset arr[currentrow][1]=emp_id>
    <cfset arr[currentrow][2]=name>
    </cfloop> --->
    <cfreturn arr>
    </cffunction>
    <cffunction name="getEmployeeDetails" access="remote" output="false" returntype="query">
    <cfargument name="employee_id">
    <cfset var employeeDetails = queryNew("","")>
    <cfset var emp_id = arguments.employee_id>
    <cfif isNumeric(emp_id)>
        <cfquery name = "employeeDetails" dataSource = "cfdocexamples">
            SELECT firstname, email as email_name, department, phone, location
            FROM Employees
            WHERE emp_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#emp_id#">
        </cfquery>
    </cfif>
    <!--- Will activate error-handler in the caller --->
    <cfif NOT isNumeric(emp_id) or employeeDetails.recordcount EQ 0>
        <cfthrow message="You selected no employee.">
    </cfif>
    <cfreturn employeeDetails>
    </cffunction>
    </cfcomponent>

  • Multiple submit buttons in flash form

    I need to make this page so that when the submit button is
    pressed, the action page will be based on the cfforgroup, not on an
    overall form action. Essentially I have 2 main tabs and multiple
    tabs underneath each one of those that need seperate action calls
    on submit:
    <cfquery name="modelinfo" datasource="inventory">
    SELECT cd_manufacturer.name + ' ' +
    model + ' ' +
    processor_type + ' ' +
    processor_speed AS system,
    cd_manufacturer.name + ',' +
    model + ',' +
    processor_type + ',' +
    processor_speed AS val_list
    FROM cd_manufacturer
    INNER JOIN cd_model ON
    cd_manufacturer.pk_manufacturer=cd_model.fk_manufacturer
    </cfquery>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title></title>
    </head>
    <cfquery name="modelinfo" datasource="inventory">
    SELECT cd_manufacturer.name + ' ' +
    model + ' ' +
    processor_type + ' ' +
    processor_speed AS system,
    cd_manufacturer.name + ',' +
    model + ',' +
    processor_type + ',' +
    processor_speed AS val_list
    FROM cd_manufacturer
    INNER JOIN cd_model ON
    cd_manufacturer.pk_manufacturer=cd_model.fk_manufacturer
    </cfquery>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>IT Asset Tracking System Main Menu</title>
    </head>
    <body>
    <cfform format="flash">
    <cfformgroup type="tabnavigator"><!--begin main
    navigation-->
    <cfformgroup type="page" label="Asset"><!-- Begin
    sub page ASSET---->
    <cfformgroup type="tabnavigator"><!-- Begin sub
    page ASSET navigator---->
    <!---ADD ASSET START (uses asset_processes/newAsset.cfm
    for processing)---------------------->
    <cfformgroup type="page" label="Add Asset"
    action="asset_processes/newAsset.cfm">
    <cfset vdate=DateFormat(Now(), "mm/dd/yyyy")>
    <cfinput type="datefield" name="cdate" width="150"
    label="Entry Date" validateat="onSubmit" validate="noblanks"
    required="yes">
    <cfselect
    label="System Type"
    name="modelinfo"
    query="modelinfo"
    required="yes"
    multiple="no"
    display="system"
    value="val_list"
    width="350">
    </cfselect>
    <cfinput type="text" name="location" width="150"
    label="location" validateat="onSubmit" validate="noblanks"
    required="yes">
    <cfinput type="text" name="user" width="150" label="user"
    validateat="onSubmit" validate="noblanks" required="yes">
    <cfinput type="submit" name="submit" value="Create New
    Asset" />
    </cfformgroup><!--end page Add Asset -->
    <!------------END PAGE ADD
    ASSET------------------------------------------------------>
    <!--------------- Assign LotID START (uses
    standard/assignLotID.cfm for processing)--->
    <cfformgroup type="page" label="Assign lotID">
    </cfformgroup><!--end page Assign LotID -->
    <!-----------------ASSIGN LOTID
    END------------------------------>
    <!----------------------Add to surplus
    START--------------------->
    <cfformgroup type="page" label="Add to Surplus">
    </cfformgroup><!--end page add to surplus -->
    <!------------------END ADD TO
    SUPLUS------------------------------>
    <!---------------------------ADD OTHER
    START----------------------->
    <cfformgroup type="page" label="View Inventory (not
    surplused)">
    </cfformgroup><!-- end page "View Inventory (not
    surplused)"-->
    <!---------------------------END
    OTHER---------------------------->
    </cfformgroup><!-- end sub page ASSET--------->
    </cfformgroup><!-- end sub page ASSET
    navigator---->
    <cfformgroup type="page"
    label="maintenance"><!--begin sub page maintenance-->
    </cfformgroup><!--end sub page maintenance-->
    </cfformgroup><!-- end main navigation -->
    </cfform>
    </body>
    </html>

    Here's my code and thanks for your help!
    <!--- begin form --->
    <cfform format="flash" width="850" height="750"
    action="insert.cfm" skin="haloblue">
    <!--- begin tab navigator --->
    <cfformgroup type="tabnavigator">
    <!--- Begin check out tab --->
    <cfformgroup label="Equipment Check-Out" type="page"
    width="600">
    <cfinput type="datefield"
    name="dueDate"
    label="Due Date:" message="Please Select a Valid Due Date"
    validate="date"
    required="yes"
    width="100">
    <!--- Equipment Information --->
    <cfselect enabled="yes" name="equipTag" size="1"
    label="Select Property Tag:" required="yes" multiple="no"
    width="100">
    <cfoutput query="allEquipTag">
    <option value="#equipTag#">#equipTag#</option>
    </cfoutput>
    </cfselect>
    <!--- Person Information --->
    <cfinput type="text"
    name="csulbID"
    label="CSULB ID:"
    message="A CSULB ID is required and must be 9 Digit!"
    mask="999999999"
    required="yes"
    size="10"
    maxlength="9" >
    <cfinput type="text"
    name="fName"
    label="First Name:"
    message="A First Name is required!"
    required="yes"
    size="10" >
    <cfinput type="text"
    name="lName"
    label="Last Name:"
    message="A Last Name is required!"
    required="yes"
    size="10" >
    <cfinput type="text"
    name="phone"
    label="Phone Number:"
    message="Phone Number is required!" mask="999-999-9999"
    required="yes"
    size="10" >
    <cfinput type="text"
    name="email"
    label="Email:"
    message="Email required! i.e. [email protected]"
    required="yes"
    validate="email"
    size="15" >
    <cftextarea name="notes"
    label="Additional Notes:"
    rows="5"
    width="300"/>
    <cfinput type="submit" name="btnSubmit" Label='checkOut'
    tooltip="Submit Check-Out Information" id="btnSubmit"
    value="Submit">
    <!--- end check-out tab--->
    </cfformgroup>
    <!--- start Check-In Tab --->
    <cfformgroup label="Equipment Check-In" type="page"
    width="850" height="700">
    <!--- start data grid--->
    <cfgrid name="equipCheckInGrid"
    query="equipCheckIn"
    selectmode="browse"
    griddataalign="left"
    height="300"
    width="800">
    <!--- Don't show all columns and change header
    name--->
    <cfgridcolumn name="dueDate" header="Due Date">
    <cfgridcolumn name="checkOut" header="Checked Out">
    <cfgridcolumn name="checkIn" header="Checked In">
    <cfgridcolumn name="csulbID" header="CSULB ID">
    <cfgridcolumn name="fName" header="First Name">
    <cfgridcolumn name="lName" header="Last Name">
    <cfgridcolumn name="phone" header="Phone">
    <cfgridcolumn name="email" header="Email">
    <cfgridcolumn name="notes" header="Additional Notes">
    <cfgridcolumn name="equipTag" header="Equip Tag">
    <!--- end data grid--->
    </cfgrid>
    <!--- start input fields--->
    <cfinput type="text"
    name="checkInEquipTag"
    label="Equipment Tag:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['equipTag']}"
    size="15">
    <cfinput type="text"
    name="checkInDueDate"
    label="Due Date:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['dueDate']}"
    size="15">
    <cfinput type="text"
    name="checkInCheckOut"
    label="Checked Out:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['checkOut']}"
    size="15">
    <cfinput type="text"
    name="checkInCheckedIn"
    label="Checked In:"
    width="150"
    value="#DateFormat(now(), "MM/DD/YYYY")#">
    <cfinput type="text"
    name="checkInCSULBID"
    label="CSULB ID:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['csulbID']}"
    size="15">
    <cfinput type="text"
    name="checkInFName"
    label="First name:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['fName']}"
    size="15">
    <cfinput type="text"
    name="checkInLName"
    label="Last Name:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['lName']}"
    size="15">
    <cfinput type="text"
    name="checkInPhone"
    label="Phone:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['phone']}"
    size="15">
    <cfinput type="text"
    name="checkIneEmail"
    label="Email:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['email']}"
    size="15">
    <cftextarea type="text"
    name="checkInNotes"
    label="Additional Notes:"
    bind="{equipCheckInGrid.dataProvider[equipCheckInGrid.selectedIndex]['notes']}"
    width="300"
    rows="5"/>
    <cfinput type="submit" name="btnUpdate" Label='update'
    tooltip="Submit Update Information" id="btnSubmit"
    value="Check-In">
    <!--- end Check-In Tab --->
    </cfformgroup>
    <!--- overdue tab --->
    <cfformgroup label="Equipment Over-Due" type="page"
    width="850" height="700">
    <cfgrid name="equipOverDueGrid"
    query="equipOverDue"
    selectmode="browse"
    griddataalign="left"
    height="300"
    width="800">
    <!--- Don't show all columns and change header
    name--->
    <cfgridcolumn name="dueDate" header="Due Date">
    <cfgridcolumn name="checkOut" header="Checked Out">
    <cfgridcolumn name="checkIn" header="Checked In">
    <cfgridcolumn name="csulbID" header="CSULB ID">
    <cfgridcolumn name="fName" header="First Name">
    <cfgridcolumn name="lName" header="Last Name">
    <cfgridcolumn name="phone" header="Phone">
    <cfgridcolumn name="email" header="Email">
    <cfgridcolumn name="notes" header="Additional Notes">
    <cfgridcolumn name="equipTag" header="Equip Tag">
    <!--- end data grid--->
    </cfgrid>
    </cfformgroup>
    <!--- end tab navigator--->
    </cfformgroup>
    </cfform>

  • Cfselect populating cfinput readonly?

    Good morning all,
    I have a form that I want to use cfselect to drop employee FN and LN from the drop down username into a readonly cfinput. Do I need to bind or what is the best method to accomplish this? I also want to open a new form (popup) to select from there to other fields in the original form. I know the second part is javascript but can anybody point me in the right direction?
    Thanks in advance,
    djkhalif

    BKBK,
    I made a change that did not work. I corrected it, now the code works fine.
    <cfform format="flash" id="FI" name="FI" action="../ActionPages/finalinspectionaction.cfm" method="post" width="550" height="600">
    <cfinput type="datefield" value="#dateformat(Now(), 'mm/dd/yyyy')#" name="inspectionDate" width="120" label="Date of Inspection">
    <cfinput type="text" name="WorkOrder" required="yes" message="Oops! You must enter the Work Order Number" width="120" label="Work Order">
    <cfselect name="inspectedById" query="inspectBy" value="FullName" display="inspBy" label="Select your name as the Inspector" width="60" required="yes">
    </cfselect>
    <cfinput name="InspectedByName" type="text" width="120" readonly="true" label="Inspected By" bind="{inspectedById.text}">
    <cfinput name="totalInspected" type="text" width="60" readonly="true" label="Total Inspected">
    <cfinput name="totaldefective" type="text" width="60" readonly="true" label="Total Defective:">
    <cfinput name="totaldefects" type="text" width="60" readonly="True" label="Total Defects:">
    <cftextarea name="notes" cols="30" rows="5" label="Comments / Notes"></cftextarea>
    <cfinput type="submit" name="submit" value="Submit">
    <cfinput type="reset" name="clear" value="Clear Form">
    </cfform>

  • CFselect onchange doesn't work on flash Form

    Hello :
    I have looked for more than a week to find out answer  but couldn't fine anything.
    I have cform with tye="Flash" and cfselect with query to populate the values.
    I want use onchange="" after I select any value on cfselect to submit the pages and select next cfselect. But doesn't work.
    Some help me
    When I used onchange="submitform();" the form doesn't display.
    I used geturl() and page reload but doesn't submit the page.
    I use this code that i found on Adobe web page and still doesn't work.
    <cfsavecontent variable="
    showSelectedCheckbox">
    var checkboxCount = 3;
    for(var i = 1; i <= checkboxCount; i++)
         var thisItem = 'check' + i;
         if(i == itemSelect.value)
              this[thisName].enabled = true;
         else
              this[thisName].enabled = false;
    </cfsavecontent>
    <cfform format="flash" width="300" height="500">
         <cfinput name="check1" type="checkbox"
              label="Feed?" enabled="true" />
         <cfinput name="check2" type="checkbox"
              label="Mine?" enabled="false"/>
         <cfinput name="check3" type="checkbox"
              label="Eat?" enabled="false"/>
         <cfselect name="itemSelect" label="Select Item"
              onchange="#showSelectedCheckbox#">
              <option value="1">Animal</option>
              <option value="2">Mineral</option>
              <option value="3">Vegetable</option>
         </cfselect>
    </cfform>
    I read about cffromitem or cfformgroup but i don't know how used it .
    Somebody Can help me to result this problem.

    I did everything written ''it solved'' but nothing solved. I think I'll begin to use chrome :(

  • Help with OnChange in cfselect

    Hello
    I'm hoping somebody can help me.
    I am using cfform with "flash" format and what I am trying to
    do is open an edit form and requery the cfselect box onChange.
    Basically the form has a cfselect field at the top and when the
    cfselect field is changed I want the other fields on the form to be
    updated with the correct information.
    <cfformgroup type="horizontal" label="Catchment ID:">
    <cfselect enabled="yes" name="CatchmentID" tooltip="Enter
    Catchment ID" required="yes" message="Enter Catchment ID"
    multiple="no" query="getCMTQry" value="CatchmentID"
    selected="#getCMTQry.CatchmentID#">
    <option value="#getCMTQry.CatchmentID#"
    <cfif (isDefined("getCMTQry.CatchmentID")
    AND getCMTQry.CatchmentID
    EQ getCMTQry.CatchmentID)>
    </cfif>>
    </option>
    </cfselect>
    <cfinput type="text" name="CatchmentName"
    label="CatchmentName:" message="Enter Catchment Name" size="37"
    required="yes" tooltip="Enter Catchment Name">
    <cfinput type="text" name="CatchmentCostCentre"
    label="Cost Code:" value="#getCMTQry.CatchmentCostCentre#"
    tooltip="Enter Cost Code" size="10">
    </cfformgroup>
    Thank you in advance for any help.
    Diane

    What modem do you have?
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • CFINPUT with datefield type issue

    I have a personal information form that has a hire date entry
    field. I would like to make the field optional, yet I have to enter
    a hire date as I get an error if I dont. The database autofills the
    hire date field with the word "null" so if I submit the form
    without entering a date, I get an error message saying: "Error
    "null" is an invalud date or time string."
    Also, in my database, I have Hire Date as a type DATE, null
    is selected, and default is 0000-00-00. On a side note, even though
    I have 0000-00-00 entered as the default, the word "null" still
    populates the hire date field on the page.
    Here is my code:
    <cfformgroup type="horizontal" visible="yes" enabled="yes"
    style="marginLeft:-74;" >
    <cfinput type="Datefield" name="HireDate" label="Hire
    Date:" width="80" bind="{contactList.selectedItem.HireDate}"
    onchange="UpdateSelect(HireDate, selectYear1);"/>
    <cfselect name="selectYear1" width="80" label=""
    onchange="setStartYear(HireDate, selectYear1);">
    <cfoutput>
    <option value="">Pick Year</option>
    <cfloop index="i" from="1935" to="#thisyear#">
    <option value="#i#">#i#</option>
    </cfloop>
    </cfoutput>
    </cfselect>
    </cfformgroup>
    Any help with this problem would be much appreciated.
    Thanks,
    Nick Butler

    Hi Nick,
    I am not sure which insert method you are using for inserting
    your form information into the database. I prefer to insert
    my
    form information via a <cfquery>.
    Below is the code I use in my forms and have not encountered
    any issues with blank date fields being inserted into a DB.
    <cfquery name="qry_name" datasource="yourdatasource">
    Insert Into tbl_name (
    db_field,
    hiredate,
    db_field)
    Values(
    nullif(<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#form.form_field#">,''),
    nullif(<cfqueryparam cfsqltype="CF_SQL_DATE"
    value="#form.hiredate#">,''),
    nullif(<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
    value="#form.form_field#">,'')
    </cfquery>
    With the above code, should the person leave the hire date
    field blank, it will
    insert a null value into the db field. If the person enters a
    date, it will insert the
    date into the db field formatted as yyyy-mm-dd.
    Leonard B

  • CFSELECT With XML Forms

    I'm using cfselect with a "Please select..." option before
    the query is displayed. This all works fine except my option as a
    value="" which get translated in the rendered HTML as option
    value="&quot;&quot;" when what I want is a CF [empty
    string].
    Any thoughts how to return a empty string?
    TIA

    The following code returns an empty string as you can see
    from the struct output:
    <!--- Get the employee names from the database. --->
    <!--- Use SQL to create a Name field with first and last
    names. --->
    <cfquery name = "GetAllEmployees" dataSource =
    "cfdocexamples">
    SELECT Emp_ID, EMail, Phone, Department, FirstName,
    LastName, FirstName +' '
    +lastName as Name
    FROM Employees
    GROUP BY Department, Emp_ID, EMail, Phone, FirstName,
    LastName, FirstName
    </cfquery>
    <h2>cfselect Example</h2>
    <!-- The cfif statement is true if the form was submitted.
    Show the selected names. --->
    <cfif IsDefined("form.employeeid")>
    <!--- The form was submitted. --->
    <h4>You Selected the following employees</h3>
    <cfif form.employeeid IS "">
    <!--- Select All option was selected. Show all employees.
    --->
    <cfoutput query="GetAllEmployees">
    #name#<br>
    Email: #email#<br><br>
    </cfoutput>
    <cfdump var="#form#">
    <cfelse>
    <!--- Use a query of queries to get the data for the
    selected users.
    Form.employeeid is a comma-delimited list of selected
    employee IDs. --->
    <cfquery name = "GetSelectedEmployees" dbtype="query">
    SELECT Emp_ID, EMail, Phone, Department, FirstName,
    LastName, FirstName
    +' ' +lastName as Name
    FROM GetAllEmployees
    WHERE Emp_ID in (#form.employeeid#)
    </cfquery>
    <!--- Display the names and e-mail addresses from the
    query. --->
    <cfoutput query="GetSelectedEmployees">
    #firstName# #lastName#<br>
    Email: #email#<br>
    <br>
    </cfoutput>
    </cfif>
    </cfif>
    <!--- The cfform tag posts back to the current page.
    --->
    <h3>Select one or more employees</h3>
    <cfform action = "#CGI.SCRIPT_NAME#" format="xml">
    <!--- Use cfselect to present the query's LastName
    column, grouped by department.
    Allow Multiple selections.--->
    <cfselect
    name = "employeeid"
    size = "1"
    multiple="yes"
    required = "No"
    query = "GetAllEmployees"
    group="Department"
    display ="name"
    value ="emp_id"
    queryPosition="Below" width="100">
    <!--- Add an option to select all employees. --->
    <option value = "">Select All</option>
    </cfselect>
    <cfinput type="submit" name="submit" label="Go"
    value="Go">
    </cfform>
    struct (cfdump) output
    EMPLOYEEID [empty string]
    FIELDNAMES EMPLOYEEID,SUBMIT
    SUBMIT Go

  • Outputting one cfselect fine now two

    Hi all,
    I am using coldfusion cfform in flash format -maybe this is
    the place to come for an actionscript question. The cfgrid tag
    works fine for one field the "state" field output with cfselect
    with the following onchange actionscript:
    <cfform format="Flash" skin="haloblue">
    <cfgrid name="UsersGrid" format="Flash"
    query="qNames" rowheaders="No"
    onchange="for (var i:Number = 0; i<state.length; i++) {if
    (state.getItemAt(
    ).data == UsersGrid.selectedItem.state) state.selectedIndex =
    i}">
    What I want to get is
    onchange="for (var i:Number = 0; i<state.length; i++) {if
    (state.getItemAt().data == UsersGrid.selectedItem.state)
    state.selectedIndex = i}"
    AND
    onchange="for (var i:Number = 0; i<meetingtime.length;
    i++) {if (meetingtime.getItemAt(
    ).data == UsersGrid.selectedItem.meetingtime)
    meetingtime.selectedIndex = i}">
    so I can connect to my meetingtime field and db field. I just
    don´t know how , thank you for any help.
    <cfgridcolumn name="FIRSTNAME" header="Contact Name">
    <cfgridcolumn name="ENTID" display="FALSE">
    <cfgridcolumn name="state" header="Next Step">
    </cfgrid>
    <cfformgroup type="tabnavigator">
    <cfformgroup type="page" label="Details:
    #dateFormat(now(), 'mmm dd, yyyy')#">
    <cfformgroup type="horizontal">
    <cfinput type="text" name="FIRSTNAME" label="First Name"
    bind="{UsersGrid.dataProvider[UsersGrid.selectedIndex]['FIRSTNAME']}"
    onChange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex,
    'FIRSTNAME', FIRSTNAME.text);">
    <cfselect name="state" width="200" size="1" label="Next
    Step"
    onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex,
    'state', state.selectedItem.data);">
    <option value="nulo">None</OPTION>
    <option value="SEND STUDY">SEND STUDY</OPTION>
    <option value="SEND PROPOSAL">SEND
    PROPOSAL</OPTION>
    <option value="CALL AND EMAIL">CALL AND
    EMAIL</OPTION>
    <option value="CALL">CALL</OPTION>
    <option value="SEND PRESENTATION">SEND
    PRESENTATION</OPTION>
    <option value="MEETING">MEETING</OPTION>
    </cfselect>
    <cfinput type="hidden" name="ENTID" label="ENTID"
    bind="{UsersGrid.dataProvider[UsersGrid.selectedIndex]['ENTID']}"
    onChange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex,
    'ENTID', ENTID.text);">
    </cfformgroup>
    </cfform>

    A similar thing happened to me. My MacBook went in two weeks ago because the built-in iSight was failing intermittently. It spent some time at the repair depot waiting for a main logic board.
    I got the call this morning that it was back at the local Apple Store.
    The clerk brought it out from the storeroom, I pressed the power button, and was treated to a weird display of multi-colored vertical lines.
    Now, the MacBook is on its way back to the repair depot to see what's wrong now.
    The only small consolation is that I've learned Apple's term for such not-quite-repaired machines. I'm the proud owner of a "looper."
    MacBook 2.0GHz SuperDrive "the looper"   Mac OS X (10.4.7)   My MacBook's getting more vacation this summer than I am!

  • Select in cfselect from cfgrid

    Form is flash CF 7.01
    Is there a way to have a cfselect "selected" option chosen by
    a cfgrid
    selection either by binding or flash remote?
    Here is my form. Thanks for any help you can give...
    The binding on the second cfselect does not work.
    <cfform action="maina.cfm" method="post" name="usermaint"
    preservedata="true" preloader="yes" format="flash"
    height="500" width="400"
    skin="haloblue">
    <cfformgroup type="tabnavigator" visible="yes"
    enabled="yes"
    name="mytab" id="mytab" onchange="#getdata#"
    style="backgroundAlpha: 0;"
    wmode="transparent">
    <cfformgroup type="page" label="New User"
    selectedindex="1"
    visible="yes" enabled="yes">
    <cfinput type="text" name="uName" message="A user name is
    required"
    label="User Name" required="yes">
    <cfinput type="password" name="password" message="A
    password is
    required" label="Password" required="yes">
    <cfinput type="password" name="password1" message="A
    confirming
    password is required" label="Confirming password"
    required="yes">
    <cfselect name="SecLevel" size="1" label="Security"
    query="secl"
    value="level" display="level" selected="User"
    width="75"></cfselect>
    <cfinput type="button" name="Submit" value="Submit"
    onclick="#adduser#">
    </cfformgroup>
    <cfformgroup type="page" label="Edit User"
    selectedindex="1"
    visible="yes" enabled="yes">
    <cfgrid name="userslist" height="165" width="250"
    query="listusers"
    selectmode="edit" format="flash" autowidth="true">
    <cfgridcolumn name="uName" header="User Name"
    headeralign="left"
    dataalign="left" width="86" bold="no" italic="no" select="no"
    display="yes"
    headerbold="no" headeritalic="no" />
    <cfgridcolumn name="SecLevel" header="Admin"
    headeralign="left"
    dataalign="left" width="46" bold="no" italic="no" select="no"
    display="yes"
    headerbold="no" headeritalic="no" />
    </cfgrid>
    <cfinput type="text" name="uNameA" message="A user name
    is required"
    bind="{userslist.selectedItem.uName}" label="User Name"
    required="yes">
    <cfinput type="password" name="passwordA" message="A
    password is
    required" bind="{userslist.selectedItem.password}"
    label="Password"
    required="yes">
    <cfinput type="password" name="password1A" message="A
    confirming
    password is required"
    bind="{userslist.selectedItem.password}"
    label="Confirming password" required="yes">
    <cfselect name="SecLevelA" size="1" label="Security"
    query="secl"
    value="level" display="level"
    selected="{userslist.selectedItem.SecLevel}"
    width="75"></cfselect> <cfinput type="button"
    name="SubmitA"
    value="Update" onclick="#edituser#">
    </cfformgroup>
    </cfformgroup>
    </cfform>

    Never mind figured it out using remoting.
    myService.getselect(gridname.selectedItem.fieldname);
    "Rick" <[email protected]> wrote in message
    news:[email protected]...
    > Form is flash CF 7.01
    >
    > Is there a way to have a cfselect "selected" option
    chosen by a cfgrid
    > selection either by binding or flash remote?
    >
    > Here is my form. Thanks for any help you can give...
    >
    > The binding on the second cfselect does not work.
    >
    > <cfform action="maina.cfm" method="post"
    name="usermaint"
    > preservedata="true" preloader="yes" format="flash"
    height="500"
    > width="400" skin="haloblue">
    > <cfformgroup type="tabnavigator" visible="yes"
    enabled="yes"
    > name="mytab" id="mytab" onchange="#getdata#"
    style="backgroundAlpha: 0;"
    > wmode="transparent">
    > <cfformgroup type="page" label="New User"
    selectedindex="1"
    > visible="yes" enabled="yes">
    >
    > <cfinput type="text" name="uName" message="A user
    name is required"
    > label="User Name" required="yes">
    > <cfinput type="password" name="password" message="A
    password is
    > required" label="Password" required="yes">
    > <cfinput type="password" name="password1" message="A
    confirming
    > password is required" label="Confirming password"
    required="yes">
    > <cfselect name="SecLevel" size="1" label="Security"
    query="secl"
    > value="level" display="level" selected="User"
    width="75"></cfselect>
    > <cfinput type="button" name="Submit" value="Submit"
    > onclick="#adduser#">
    > </cfformgroup>
    > <cfformgroup type="page" label="Edit User"
    selectedindex="1"
    > visible="yes" enabled="yes">
    > <cfgrid name="userslist" height="165" width="250"
    query="listusers"
    > selectmode="edit" format="flash" autowidth="true">
    > <cfgridcolumn name="uName" header="User Name"
    headeralign="left"
    > dataalign="left" width="86" bold="no" italic="no"
    select="no"
    > display="yes" headerbold="no" headeritalic="no" />
    > <cfgridcolumn name="SecLevel" header="Admin"
    headeralign="left"
    > dataalign="left" width="46" bold="no" italic="no"
    select="no"
    > display="yes" headerbold="no" headeritalic="no" />
    > </cfgrid>
    > <cfinput type="text" name="uNameA" message="A user
    name is
    > required" bind="{userslist.selectedItem.uName}"
    label="User Name"
    > required="yes">
    > <cfinput type="password" name="passwordA" message="A
    password is
    > required" bind="{userslist.selectedItem.password}"
    label="Password"
    > required="yes">
    > <cfinput type="password" name="password1A" message="A
    confirming
    > password is required"
    bind="{userslist.selectedItem.password}"
    > label="Confirming password" required="yes">
    > <cfselect name="SecLevelA" size="1" label="Security"
    query="secl"
    > value="level" display="level"
    selected="{userslist.selectedItem.SecLevel}"
    > width="75"></cfselect> <cfinput
    type="button" name="SubmitA"
    > value="Update" onclick="#edituser#">
    > </cfformgroup>
    > </cfformgroup>
    > </cfform>
    >

  • How do you populate cfselect when cfgrid selected row is changed

    hi can anyone enlighten me as to how to pass data to a
    cfselect from a cfgrid
    i am using a listner function so that the grid can populate
    form controlswhen a row is selected
    i use bindings on cfinputs so no problem there
    how do u populate a cfselect drop down with data from a grid
    and then how woul i also display query results from another
    query as a second option
    lost
    yes i dont konw much as
    realyy apprecitae your help

    Unfortunately, there's no 'tab-out' event in ABAP standard dynpros - you've got to trigger a PAI event to make that happen (such as hitting 'Enter').

  • CFSELECT validation in Flash format form

    In the past, I have used Javascript validation in CFFORMs to
    validate CFSELECT input, due to the bug in Coldfusion validation
    (most of my client sites are on shared servers, so I can't modify
    the cfform.js file).
    The Javascript I found somewhere worked great:
    <!-- Validation Functions -->
    <SCRIPT LANGUAGE = "JavaScript">
    function ExtendJS(FormName) {
    if (!SingleSelectRequired(FormName,'Event_Description')) {
    alert("You must select a Vendor from the drop-down list.");
    return false;
    function
    SingleSelectRequired(Form, Field) {
    var itemSelected =
    eval("document." + Form + "."
    + Field + ".selectedIndex");
    if (itemSelected == 0) {
    return false;
    } else {
    return true;
    </SCRIPT>
    Then, in my CFFORM tag:
    <cfform
    name = "formName"
    action = "index.cfm?section=4&submit=1"
    preservedata="Yes"
    enctype = "multipart/form-data"
    method = "POST"
    format = "HTML"
    onSubmit = "return ExtendJS('FormName')">
    Now I'm exploring CFFORM format="Flash"... well, not just
    exploring, way down the road developing a web app ... and I've
    discovered my old validation methods don't work. It seems I have to
    use Actionscript now.
    Does anyone have a good Actionscript form validation
    implementation they can share with me? Or point me in a different
    direction if I'm off base here?
    Thanks,
    max

    It's hard for me to believe I'm the only one who has had
    problems with CFFORM format="flash" cfselect validation. But hours
    of searching turned up VERY LITTLE. I managed to cobble something
    together, so for anyone else who has this problem, and happens
    across my post, here's how I solved it:
    <cfsavecontent variable="validate">
    // perform client side validation here if you want
    var validationError = "False";
    var myString = "Please Select a value for the following:";
    var alertTitle = "Data Input Required";
    if (theForm.testSelect.value == 'none')
    var validationError = "True";
    var myString = myString + " Location,";
    if (theForm.testSelect2.value == 'none')
    var validationError = "True";
    var myString = myString + " Option2,";
    if (validationError == 'True')
    alert(myString,alertTitle);
    return false;
    </cfsavecontent>
    <cfform name="theForm" action="" format="flash"
    height="220" width="450" onSubmit="#validate#">
    <cfselect name="testSelect" width="100" size="1"
    multiple="no" required="Yes" query="q1" display ="firstname" value
    ="firstname" selected="" queryPosition="Below">
    <option value="none">Select One
    </cfselect>
    <cfselect name="testSelect2" width="100" size="1"
    multiple="no" required="Yes" query="q1" display ="lastname" value
    ="lastname" selected="" queryPosition="Below">
    <option value="none">Select One
    </cfselect>
    <cfinput name="Location" type="text" label="Location"
    value="" width="300" required="Yes" message="Please provide a
    location" />
    <cfinput name="Test2" type="text" label="Test" value=""
    width="300" required="Yes" message="Please provide a test" />
    <cfinput type="submit" name="submitBtn" value="Send Data"
    width="100">
    </cfform>

  • cfselect with bind to cfc works but is followed by 500 Jrun javax.servlet.ServletException

    All;
    This is driving me crazy. 
    I have a CFC with a function that returns countries via remote as JSON with the // prefix as Cold Fusion is configured.
    I call it with the following url
    www.mydomain.com/getCountriesAndStates.cfc?method=getCountries&returnFormat=json&argumentC ollection={}&_cf_nodebug=true&_cf_nocache=true
    It returns countries according to the Cold Fusion specs (just imagine it returning all countries, didn't want to paste it all the countries here).
    //[[0.0,"Please select a country..."],["US","UNITED STATES"],["CA","CANADA"]] 
    I bind a <cfselect for countrycode to this CFC and it works about 30% of the time.
    Here is the <cfselect
    <cfselect name="CountryCode" id="spanCountryCode" bind="cfc:getCountriesAndStates.getCountries()" bindonload="true"  onChange="DEdetermineTohide(this.id, '1')" onKeyUp="DEdetermineTohide(this.id, '1')">   
            </cfselect>
    It has a second function that returns the States with a CountryCode as the argument. 
    I call it with the follow url
    /getCountriesAndStates.cfc?method=getStateProvince&returnFormat=json&argumentCollection={" countrycode":"US"}&_cf_nodebug=true&_cf_nocache=true
    It returns states according to the old Fusion specs (just imagine it returning all the states, didn't want to paste all the states here.)
    //[[0.0,"Please select a state..."],["AL","ALABAMA"],["AK","ALASKA"]]
    I bind a <cfselect to this CFC with the countrycode as an argument and it populates the states for the countrycoe about 30% of the time.  It fails when the getCountries call fails.
    Here is the State <cfselect
    <cfselect name="StateCode" bind="cfc:getCountriesAndStates.getStateProvince({CountryCode})">
            </cfselect>
    I have a third funtion that returns whether or not the country selected has States and Zip Codes.  I call this function from a seperate javascript script included in the header and fired from the <cfselect name="CountryCode for onChange or onKeyUp.  It basically determines whether or not to show or hide both the State or Zip span but calls the CFC so that I can encapsulate everything in one place.  So the state and zip span with <cfselect and <cfinput appear and disappear based on the information about the country and state and the labels can change too from State to Province and from Zip to Postal Code etc...
    /getCountriesAndStates.cfc?method=getStateZipMetaData&returnFormat=json&argumentCollection ={"countrycode":"US"}&_cf_nodebug=true&_cf_nocache=true
    Ok, so I hope I have described enough about what I am doing.  This works about 30% of the time and fails about 70% of the time.  Flawlessly.  Sometimes it works for hours.  But eventually for some reason AFTER a perfectly good JSON response is returned from Cold Fusion, the Cold Fusion server starts following the JSON response with a 500 Serverlet Exception error.  This happesn on all function calls until I reboot my machine.
    It is driving me mad and making me start to reconsider whether or not I want to use CFForm binding.  It seems like a nice elegant solution that really simplifies and reduces the amount of javascript I have to write, but I can't go to production with forms that produce 500 server errors.
    Anyone have any ideas on what is going on?  If this is a bug?
    Should I just stay away from <cfform binding?
    Please help because it is driving me really crazy.
    My platform information is below.
    About 70% of the time it returns all the countries followed by a 500 Servlet Exception error.
    500
    javax.servlet.ServletException
         at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:154)
         at coldfusion.xml.rpc.CFCServlet.doGet(CFCServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
         at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
         at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
         at jrun.servlet.FilterChain.service(FilterChain.java:101)
         at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
         at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
         at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
         at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
         at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
         at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
         at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
         at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    Platform details
    Server Product
    ColdFusion
    Version
    9,0,0,251028 
    Edition
    Developer 
    Operating System
    Windows XP 
    OS Version
    5.1 
    Adobe Driver Version
    4.0 (Build 0005) 
    JVM Details
    Java Version
    1.6.0_14 
    Java Vendor
    Sun Microsystems Inc. 
    Java Vendor URL
    http://java.sun.com/ 
    Java Home
    C:\ColdFusion9\runtime\jre 
    CF9 Update 1
    Apache 2.2
    Database MS-SQL Express

    Ok, so I think I answered this for myself.  This may be ignorant.  Whatever.  I haven't programmed CF in over 10 years and just started again a month ago, so I think advanced CFC and javascript is a lot.
    I seperated my CFC into a directory with a Alias mapping under Apache and a CF Mapping from CFIDE
    I trimmed down the application.cfc
    It was
    <cfset This.clientstorage="Cookie">
    That was causing the remoting CFC's to return a 500 Jrun Servlet Error
    I am just going to keep my remote CFC's seperate from the rest of my application anyway because they need a different type of security schema.
    So, if anyone struggles with this.  I recommend just put your remotely accessd CFC's in a seperate virtual directory mapped from your webserver and CF and lock them down both with a trimmed down application.cfc and some kind of security.
    They also seem to run much faster now combined with my other Ajax and Javascript.

  • Show or hide form fields based on cfselect selection

    Hi,
    I'm using ColdFusion 9 and
    I want to show/hide a form field type=checkbox if an assigned value is selected in a dropdown list, but it doesn't work.
    I use a javascript function.
    My question is: Are there better possibilities with ColdFusion to do this or is Javascript the best solution???
    Here is my code:
    <script type="text/javascript">
        function show(){
            var select = document.getElementById('dropdownlist').selectedIndex;      
            if(select == 1) document.getElementById('area').style.display = "block";
            else document.getElementById('area').style.display = "none";       
    </script>
    <cfquery name="select_list">
    select * from table
    </cfquery>
    <cfform name ="form">
    <cfselect name="dropdownlist" onChange="show();">
        <option value="0">please select</option>
        <cfloop query="select_select_list">
         <option value="#select_select_list.id#">#select_list.name#</option>
        </cfloop>       
        </cfselect>
    <div id="area" style="display:none">
             <cfloop query="select_list" > 
             <tr style="display:none">
          <td>    
               <cfinput name="gsu"  type="checkbox"  value="#select_list.id#"> #select_list.name#
              </td>
         </tr>
             </cfloop> 
         </div>
    </cfform>
    Thank you and best regards!
    Claudia

    Okay, thank you for your answer.
    I changed the javascript function and replaced the <div> with the <table> tag. Then it works.
    Here is an extract of my code:
    <script type="text/javascript">
        function show(){
            var select = document.getElementById('dropdownlist'); 
            var strUser = select.options[select.selectedIndex].value;    
            if(strUser== 1) document.getElementById('area').style.display = "block";
            else document.getElementById('area').style.display = "none";       
    </script>
    <cfquery name="select_list">
    select * from table
    </cfquery>
    <cfform name ="form">
    <table id="area" style="display:none">
             <cfloop query="select_list" > 
             <tr">
          <td>    
               <cfinput name="gsu"  type="checkbox"  value="#select_list.id#"> #select_list.name#
              </td>
         </tr>
             </cfloop> 
         </table>
    </cfform>

Maybe you are looking for

  • Jabber client cannot login when primary IMP is unavailable

    Hi We have 2 x IMP 9.1 servers in cluster and Jabber client running.  Current Jabber client work since we use IMP primary IP for login. When primary IMP server becomes unavailable, Jabber client seems cannot login anymore. How can we fixed this? Fei

  • Buy phone in canada, can/cannot use in hk?

    I wanna ask is it able to use the iphone  in hk? bcuz i order it online on apple.ca and i am using the iphone 5 in hk right now but it seems like it cant read the carrier.

  • Help required please with installof a Linksys Router iMac G5

    Thanks in advance for any advice or help. I wish to connect an iMAC G5 directly to a Linksys Router with 4 port switch. Any ideas on this as the Linksys CD does not have Apple software. Thanks Fergal.

  • Numbers 1712

    the application "numbers" can't be opened. -1712 Any ideas what this means and how to get it opened?  It was working fine until about 3 days ago This is on a 4 month old Macbook Air 13"

  • Latest quicktime update not compatible with Serato Scratch Live program

    I'm a DJ/VJ that uses the serato program which uses quicktime to run the videos. The latest update with quicktime has totally screwed up the video program and is no longer compatible with it. I can't open itunes anymore and have to use an older versi