Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
trex0911 #1
Client Side Validation
:confused;We have recently upgraded our web servers to Coldfusion MX 7.1. At
the time of this writing, we still can not get flash forms to work on the one
server (see previous topic: Clock Mouse Pointer) but that is a different issue.
We upgraded to 7.1 mainly for the flash forms, specifically the grid control.
However, I am having a real tough time understanding them. What I am stuck on
is client side validation. When working with Coldfusion MX 6, I did not use the
cfform tag because I wanted to use my own javascript form validation function.
Now, if we want to use flash forms, I need to use the cfform tag. Please review
my code snippet below, which works perfectly fine but does not yet perform any
validation:
<cfif IsDefined("Form.fieldnames")>
<cfgridupdate datasource="datasourcename" grid="cfform_grid"
tablename="atblCFFORM" keyonly="yes">
<cfelse>
<cfquery datasource="HNLSQL01_HNLForms" name="qCFFORM">
SELECT TOP 10 * FROM atblCFFORM ORDER By PatientName
</cfquery>
<cfform name="frmForm" action="formtest.cfm" format="flash" method="post">
<cfgrid name="cfform_grid" height=325 width=325 vspace=10
selectmode="edit" insert="Yes" delete="Yes"
maxrows="10" format="flash"
query="qCFFORM">
<cfgridcolumn name="RowID" display="no">
<cfgridcolumn name="Name" header="Patient Name" width=100
headeralign="center" headerbold="Yes" select="Yes">
<cfgridcolumn name="Test" header="Test" width="100" headeralign="center"
headerbold="yes" select="yes">
<cfgridcolumn name="Room" header="Room Number" width="100"
headeralign="center" headerbold="yes" select="yes">
</cfgrid>
<br>
<cfinput type="submit" name="btnSubmit" value="Submit">
</cfform>
</cfif>
1. How do I modify the cfinput type=submit button to be a cfinput type=button
that calls a javascript validation function from the onclick event? I have
tried <cfinput type="button" name="btnSubmit" value="Submit"
onclick="checkform"> but the form does not load at all when I try this. I have
changed the function call to checkform(), checkform(); and javascript:
checkform(); and nothing works. If I add a simple alert box to the onclick
event, it works, but a call to a javascript function does not? Is there a
different (better) way to validate the form? I even tried changing the grid to
an applet and then used the onvalidate event but I couldn't get that to work
either.
2. If I can get to javascript, how would I refer to the values in the
cfgridcolumns? I have tried document.frmForm.cfform_grid.Name.value and
document.frmForm.cfform_grid.Name[1].value but I get a javascript error each
time.
Please help me attain client side validation with the cfgrid control on a
flash form!
trex0911 Guest
-
Client Side validation on datagrid
Hello Group I am using template coulmns for input in datagrid how can I validate text boxes whcih are inside datagrid's template column at... -
client side validation cfinput in 6.1
Hello, This is probally a very simple question but i am trying to invoke client side validation on my inputs and i have typed this: <!--- this... -
Client side validation of a DataGrid
Hello all, I have a problem that looks simple and I think should be fairly common but wasn't able to find a solution yet. Here it is: I have a... -
Client side validation in footer row
I have a timesheet application with a variable number of rows, depending on how many projects the user is working on at the time. Each row has... -
validation summary doesnt display when there's client-side validation
I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so...



Reply With Quote

