Bobby,
  I am getting a blank value in the alert box with either

alert(employee_grid.dataProvider[employee_grid.selectedIndex]['user_emai
l'].text);

or 

alert(employee_grid.dataProvider[employee_grid.selectedIndex]['user_emai
l']);

I don't see the value passed from the cfgrid.

-----Original Message-----
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 21, 2005 6:49 PM
To: CF-Talk
Subject: RE: easy cfgrid question

<cfsavecontent variable="onchange">
if
(employee_grid.dataProvider[employee_grid.selectedIndex]['user_email']
==
'')
{
alert('Please enter an email address');
}
</cfsavecontent>

 

<cfform name="GridForm" action="cfgrid3.cfm" format="flash"
timeout="200">

 
<cfgrid name="employee_grid"
                query="empdata" selectmode="edit" insert="yes"
delete="yes"
                rowheaders="no"
                format="flash"          
                height="200"
                onchange="#onchange#" />

   <br>

   <cfinput type="Submit" name="test" value="Submit">

</cfform>


This is just an example, its not going to work for what you are trying
to
do. You wont want to do it on change but rather submit and youll want to
loop over all of the dataprovider checkin the emails, not just a
specific
one. But this should give you a good idea of how to reference them.

Hope it helps.

(I also couldn't think of the length check function in flash but youll
want
atleast that rather than == '')
 
...:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-----Original Message-----
From: Nick Han [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 21, 2005 8:58 PM
To: CF-Talk
Subject: easy cfgrid question

Hi, I have a flash form with a cfgrid that is populated by a cfquery on
page 

load. How do I check for the value and display a flash alert if the
value of email address is blank?

 

 

Here's my code snippet:

<cfsavecontent variable="onchange">

<cfoutput>

                        ///HOW DO I REFERENCE THE EMAIL FIELD VALUE FROM
GRID ?alert(GridForm.user_email[1].text);                            In
javascript, we would do something like
if(document.formName.user_email.value=="")

 

</cfoutput>

</cfsavecontent>

 

 

<cfform name="GridForm"

   action="test2.cfm" format="flash" timeout="200">

 

   <cfgrid name="employee_grid"

      height=425

      width=500

      vspace=10

      selectmode="edit"

      query="empdata"

      insert="Yes"

      delete="Yes" onchange="#onchange#">

      

 

      <cfgridcolumn name="user_last_name"

         header="Last Name"

         width=100

         headeralign="center"

         headerbold="Yes" >

 

      <cfgridcolumn name="user_first_name"

         header="First Name" 

         width=100

         headeralign="center"

         headerbold="Yes">

                         

             <cfgridcolumn name="user_email" 

         header="Email"

         width=120

         headeralign="center"

         headerbold="Yes">

 

   </cfgrid>

   <br>

   <cfinput type="Submit" name="test" value="Submit">

</cfform>







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224928
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to