• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How Can I Get the current value of a binded field for use in a conditional statement?

New Here ,
Aug 05, 2013 Aug 05, 2013

Copy link to clipboard

Copied

Hey guys, I have a CFGRID that's bound to some form fields:

<tr>

<td align="right"><span class="srch_title">First Name 1</span>:</td>

<td align="left"><cfinput name="Data_FName1" type="text" class="inputs_nomargin" bind="{SearchResultsGrid.fname1}"></td>

<td align="right"><span class="srch_title">Last/Bus Name 1</span>:</td>

<td align="left"><cfinput name="Data_LNameBus1" type="text" class="inputs_nomargin" bind="{SearchResultsGrid.lname_busname1}"></td>

<td align="right"><span class="srch_title">DOB 1</span>:</td>

<td align="left"><cfinput name="Data_DOB1" type="text" class="inputs_med_nomargin" bind="{SearchResultsGrid.dob1}"></td>

<td align="right"><span class="srch_title">DL Number 1</span>:</td>

<td><cfinput name="Data_DLNum1" type="text" class="inputs_nomargin" bind="{SearchResultsGrid.dlnum1}"></td>

</tr>

When, clicking on the CFGRID rows, the data in the form fields changes, as expected.

However, I'd like to make some other stuff happen conditionally based on current values of one or more of the form fields.

How can access, for example, the current contents of {SearchResultsGrid.fname1} in a CFIF statement?

Thanks in advance for any help you can give me

T

Views

360

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 06, 2013 Aug 06, 2013

Copy link to clipboard

Copied

LATEST

Hello Tim, would barely fit in this situation since this code resides on the client’s interaction side of things. I’d recommend using JavaScript for this matter, e.g. var Data_FName1 = document.getElementById(‘Data_FName1’).value;. If you still opt for using CFML, then you’d go for proxying your JavaScript code to a CFC.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation