Skip to main content
WolfShade
Legend
January 10, 2007
Question

Two questions (semi-newbie)

  • January 10, 2007
  • 2 replies
  • 1322 views
Hello, everyone.

I have two questions involving the Flash Forms in CF7.

1. For the built in validation, the messages are coming up in mixed order. (ie, if the required fields are FirstName, LastName, Street, City, State, Zip, Phone, Email, the messages come up LastName, Email, City, State, Street, Zip, etc.) Is there a way to force the messages to appear in the same order as the form fields?

2. I'm using a tabnavigation form, and would like to add a button to the bottom of the first tab that, when clicked, will be the same as the user clicking on the second tab at the top of the form. How can this be done?

Thank you,

^_^
This topic has been closed for replies.

2 replies

WolfShade
WolfShadeAuthor
Legend
January 16, 2007
Second problem solution works, thanks for the suggestion.

First problem solution, not an option, the client wants the alert. Is there a way to set order to the message for each form field?

Thanks,

^_^
WolfShade
WolfShadeAuthor
Legend
January 27, 2007
If the first problem cannot be resolved as requested, then is there anyone here who can either:
a) Show me how I can get Flash forms to work with JavaScript, so I can do validation that way, or
b) Show me how I can use actionscript (of which I have no knowledge) to do validation that way.

Thanks,

^_^
Participating Frequently
January 27, 2007
Try this example found on Ray Camden's blog

<cffunction name="checkFieldSet" output="false" returnType="string">
<cfargument name="fields" type="string" required="true" hint="Fields to search">
<cfargument name="form" type="string" required="true" hint="Name of the form">
<cfargument name="ascode" type="string" required="true" hint="Code to fire if all is good.">

<cfset var vcode = "">
<cfset var f = "">

<cfsavecontent variable="vcode">
var ok = true;
var msg = "";
<cfloop index="f" list="#arguments.fields#">
<cfoutput>
if(!mx.validators.Validator.isValid(this, '#arguments.form#.#f#')) { msg += #f#.errorString + "\n"; ok = false; }
</cfoutput>
</cfloop>
</cfsavecontent>
<cfset vcode = vcode & "if(!ok) { mx.controls.Alert.buttonWidth=100; mx.controls.Alert.show(msg,'Error'); }">
<cfset vcode = vcode & "if(ok) #ascode#">
<cfset vcode = replaceList(vcode,"#chr(10)#,#chr(13)#,#chr(9)#",",,")>

<cfreturn vcode>

</cffunction>
<cfform name="form1" format="flash" skin="haloblue" width="580" height="500" action="index.cfm" preservedata="yes">
<cfformgroup type="page">
<cfinput name="InsuranceName" type="text" label="Insurance Company Name:" width="150" required="yes" message="InsuranceName is Required." />
<cfinput name="PlanType" type="text" label="Plan Type:" width="150" required="yes" message="PlanType is Required." />
<cfinput name="PolicyNumber" type="text" label="Policy Number:" width="150" required="yes" message="PolicyNumber is Required." />
<cfinput name="GroupName" type="text" label="Group Name:" width="150" required="yes" message="GroupName is Required." />
<cfinput name="GroupNumber" type="text" label="Group Number:" width="150" required="yes" message="GroupNumber is Required." />
<cfinput name="Display" type="text" label="Display:" width="150" />

</cfformgroup>

<cfinput type="button" name="step3b" value="Next" onClick="#checkFieldSet("PlanType,PolicyNumber,GroupName,GroupNumber","form1","PlanType.text=InsuranceName.text")#">

</cfform>
WolfShade
WolfShadeAuthor
Legend
January 12, 2007
Is there anyone even here? Three days without a response, kinda depressing.
^_^
Participating Frequently
January 16, 2007
1st problem try placing on the cfform tag onError="" this will supress the alert which is not really needed as the input boxes are surrounded by a red box anyway

2nd problem, ensure that the tabnav has an id param specified for example id="myTabNav" then on your button
onClick="myTabNav.selectedIndex=1"

selectedIndex="0" is the 1st tab
selectedIndex="1" is the 2nd tab
etc...