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>

Similar Messages

  • Flash Format Forms No Workie

    I'm able to test a simple CFForm with Flash format on my
    personal web account and it works great. However, in the same MX 7
    environment the form won't generate. It will generate a Flash
    plugin component, but no form elements.
    I suspect that there is some possible configuration change I
    need to make on the server side for Flash formatted forms to
    appear? CFIDE directory permissions? Enable some service?
    eg, this one works:
    http://www.somareview.com/testme.cfm
    eg, this one with the same code does not work:
    http://www.clarku.edu/temp/flashform.cfm
    Thanks for any suggestions,
    Chuck

    Dear Chuck,
    I guess you have fixed the problem. Both sites work well to
    me.
    Keiko

  • Format variable using bind in a flash format form

    Greetings
    All though seems like a simple question, I seem to be missing something here. I have a form (in flash format) that calculates a value when a form item is selected. The value is actually a dollar value. I output the variable value in a cfformitem but I con't figure out how to diplay it as a dollor value, moreover, a value with trailing zeros when the value is a full dollar.
    For example:
    The amount $1.00 displays as 1 (I add the dolloar sign)
    or $23.80 displays as 23.8
    Code below:
    <cfif 
    IsDefined("Form.Submit")>
    Total Cost:
    <cfoutput>#form.TotalCost#</cfoutput><br />
    </cfif> <cfform  format="flash"><cfformitem 
    type="script">
    var charge = '';
    var p1 = 40.50;
    var p2 = 29.75;
    function cost():Void
    charge = 0;
    // share price
    if (specialneeds.value==true) {
    if (Session1.value==1) {
    charge = (charge + p2);
    if (Session2.value==1) {
    charge = (charge + p2);
    if (Session3.value==1) {
    charge = (charge + p2);
    // double price
    else {
    if (Session1.value==1) {
    charge = (charge + p1);
    if (Session2.value==1) {
    charge = (charge + p1);
    if (Session3.value==1) {
    charge = (charge + p1);
    }</cfformitem> <cfinput type="checkbox" label="Sharing?" name="specialneeds" value="true" checked="No" onClick="cost()" />
     <cfinput type="checkbox" label="Day 1" value="1" name="Session1" onClick="cost()" id="Session1" />
     <cfinput type="checkbox" label="Day 2" value="1" name="Session2" onClick="cost()" id="Session2" />
     <cfinput type="checkbox" label="Day 3" value="1" name="Session3" onClick="cost()" id="Session3" />
     <cfformitem bind="Total Cost: ${charge}" style="color:red;" type="text"></cfformitem>
     <cfinput type="hidden" id="TotalCost" name="TotalCost" bind="{charge}" />
     <cfinput type="submit" id="sumbit" name="submit" Label="Submit" value="Submit" /></cfform>
    Any ideas how I can get around this?
    Thanks for any input.

    Awesome, Thank You BKBK!
    Since I call this function several times, I just had to add:
    integerPart = 0;
    decimalPart = 0;
    decimalPartWithoutPoint = "0";
    At the beginning of the function. Commented code below for future reference.
    <cfif  IsDefined("Form.Submit")>
    Total Cost:<cfoutput>#form.TotalCost#</cfoutput><br />
    </cfif> <cfform  format="flash"><cfformitem 
    type="script">
    var charge = 0;
    var charge2 = 0;
    var integerPart = 0;
    var decimalPart = 0;
    var decimalPartWithoutPoint = "0";
    var p1 = 40.50;
    var p2 = 29.75;
    function cost():Void
    charge = 0;
    integerPart = 0;
    decimalPart = 0;
    decimalPartWithoutPoint = "0";
    // share price
    if (specialneeds.value==true) {
    if (Session1.value==1) {
    charge = (charge + p2);
    if (Session2.value==1) {
    charge = (charge + p2);
    if (Session3.value==1) {
    charge = (charge + p2);
    // double price
    else {
    if (Session1.value==1) {
    charge = (charge + p1);
    if (Session2.value==1) {
    charge = (charge + p1);
    if (Session3.value==1) {
    charge = (charge + p1);
    // Charge amount * 100, round the value to nearest whole number (cents now become dollars) and rounds to nearest cent
    charge=Math.round(charge*100)/100;
    charge2=Math.round(charge*100)/100;
    // get the closest integer that is less than or equl to the charge amount, or the dollar value
    integerPart = Math.floor(charge);
    // get the total number of cents from the transaction
    decimalPart = charge - integerPart;
    // this converts the decimalPart to a string if it is not a zero
    if (decimalPart != 0) decimalPartWithoutPoint = decimalPart.toString().split(".")[1];
    // this takes the interger & decimal values, converts it to a string then adds a "0" to the string
    if (decimalPart == 0 || decimalPartWithoutPoint.length == 1) charge = integerPart.toString() + "." + decimalPartWithoutPoint + "0";
    //var myAlert = mx.controls.Alert.show("Charge2 = " + charge2 + "\nIntegerPart = " + integerPart + "\ndecimalPart = " + decimalPart + "\nCharge = " + charge, "Math Information", mx.controls.Alert.OK, this);
    //myAlert.show;
    }</cfformitem> <cfinput type="checkbox" label="Sharing?" name="specialneeds" value="true" checked="No" onClick="cost()" />
     <cfinput type="checkbox" label="Day 1" value="1" name="Session1" onClick="cost()" id="Session1" />
     <cfinput type="checkbox" label="Day 2" value="1" name="Session2" onClick="cost()" id="Session2" />
     <cfinput type="checkbox" label="Day 3" value="1" name="Session3" onClick="cost()" id="Session3" />
     <cfformitem bind="Total Cost: ${charge}" style="color:red;" type="text"></cfformitem>
     <cfinput type="hidden" id="TotalCost" name="TotalCost" bind="{charge}" />
     <cfinput type="submit" id="sumbit" name="submit" Label="Submit" value="Submit" /></cfform>

  • Error in CF form in a Flash format...

    Hi
    I receive the following error when loading a CF form in a
    Flash format...
    Errors, warnings or exceptions were found when compiling
    /mystore/admin/purchases_not_processed.cfm. Visit the online Flex
    documentation or API reference for further information.
    1 Error found.
    Error
    C:\Inetpub\wwwroot\MyStore\admin\purchases_not_processed.cfm:4
    A function in the code exceeds the 64K byte limit (actual
    size = '122810'). Since the problem occurs in the
    compiler-generated deferred instantiation code, please
    refactor/componentize portions of this document.
    How do i overcome this error?
    I hope someone can assist with this...
    Thanks in advance...
    Regards
    Mr Pappy

    Hi
    I receive the following error when loading a CF form in a
    Flash format...
    Errors, warnings or exceptions were found when compiling
    /mystore/admin/purchases_not_processed.cfm. Visit the online Flex
    documentation or API reference for further information.
    1 Error found.
    Error
    C:\Inetpub\wwwroot\MyStore\admin\purchases_not_processed.cfm:4
    A function in the code exceeds the 64K byte limit (actual
    size = '122810'). Since the problem occurs in the
    compiler-generated deferred instantiation code, please
    refactor/componentize portions of this document.
    How do i overcome this error?
    I hope someone can assist with this...
    Thanks in advance...
    Regards
    Mr Pappy

  • Error in CF form in flash format

    Hi
    I receive the following error when loading a CF form in a
    Flash format...
    Errors, warnings or exceptions were found when compiling
    /mystore/admin/purchases_not_processed.cfm. Visit the online Flex
    documentation or API reference for further information.
    1 Error found.
    Error
    C:\Inetpub\wwwroot\MyStore\admin\purchases_not_processed.cfm:4
    A function in the code exceeds the 64K byte limit (actual
    size = '122810'). Since the problem occurs in the
    compiler-generated deferred instantiation code, please
    refactor/componentize portions of this document.
    How do i overcome this error?
    I hope someone can assist with this...
    Thanks in advance...
    Regards
    Mr Pappy

    Karl, is your problem still happening?
    If so, are you sure that your web site (is it IIS) is set so that the CFIDE it points to is the one inside CF11?  We see from the screenshot you shared that inside the stack trace it points to the page as running in some /CFIDE folder (as if it’s the root of a file system—and it’s odd, because there’s no drive reference, which would be there normally on Windows.)
    Normally, it should point to the coldfusion11\cfusion\wwwroot\CFIDE folder, which is where CF11 puts that folder by default.  If your web site is pointing at some other folder for that, it could simply be that your Admin was using a different version of code for that mail settings page than CF11 is expecting you to use.
    Let us know if that helps.
    /charlie

  • How to show long text in TextView control in formatted form?

    Hi,
    I have requirement to show long text from backend text edit control to WD application. I am using READ_TEXT Fm to read the long text and passing it to text view UI element.
    The text is shown in simply one long line but I want it to show in the same format as stored in backend textedit control.
    If I take textedit UI control then it shows the text in formatted form.
    Could you please let me know how to achieve these for TextView control? My requirement is that I have to use only TextView control.
    Thanks,
    Chandra

    Hi,
    The Problem solved to some extend but still the exact formatting is not happening though i am using cl_abap_char_utilities=>newline.
    for eg. if the long text is as below.
    "To display the external component, you can now embed an interface view of any window of this component in a window of your current embedding a view of oneu2019s own component. By setting up navigation from one outbound plug of a view of your inbound plug of the inter external component, you enable the external component to be displayed. New line ."
    and if in backend the Last line " New line ." is on next line, on WD it is not displayed on next line.
    Thanks,
    Chandra

  • Validation on a data form

    I need run a validation on a data form. Basically if the difference between budget and actuals (both of which are on a separate form, but combined on a composite) exceeds 5% I want to highlight the cell in red, or bold the text or something. Can someone point me in the right direction for this?

    Depends what version you are on, if it is before 11.1.2 then you would need to write some custom Javascript, 11.1.2 should let you write validation rules to change cell colors.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Spry validation problem for long forms

    I used the Spry Validation Widgets for my form validation. It
    works great, BUT the problem is that if you have a very long form
    and the user doesn’t fill in one of the top required fields,
    it doesn’t scroll the browser back up to the required field,
    or present a message next to the submit button telling the person
    that not all required fields have been filled in. Nothing appears
    to happen at all, which would be confusing to users. I added my own
    message underneath the Submit button which reads "If this form does
    not submit, check for required entries at the top of this page.*",
    but is there a way to add an extra popup message that could appear
    next to the Submit button instead? (I know that we can't mix the
    Validate Form behavior with the Spry Validation widgets.)

    Came across the same issue as well. To solve this I added in
    three lines of code into the 'SpryValidationTextField.js' file that
    is created via DW. Inside of that include look for the following
    code:
    if (!Spry.Widget.Form.validate) {
    Spry.Widget.Form.validate = function(vform) {
    var isValid = true;
    var isElementValid = true;
    var q = Spry.Widget.Form.onSubmitWidgetQueue;
    var qlen = q.length;
    for (var i = 0; i < qlen; i++) {
    if (!q
    .isDisabled() && q.form == vform) {
    isElementValid = q
    .validate();
    isValid = isElementValid && isValid;
    return isValid;
    Right before you return the "isValid" parameter you want to
    check and see if the value is false. If it is, have the page
    refreshed to a specific html anchor. For example:
    if (isValid == false) {
    window.location.hash = "formtop";
    return isValid;
    Where "formtop" is would be the name of your html anchor tag
    on the page. So right before my html form starts I have:
    <a name="formtop"></a>
    Hope that helps ... enjoy!
    - Larry Daughenbaugh
    http://www.jplprod.com

  • Web Gallery in non-Flash format?

    Are there any extensions or anything to allow Bridge to Export a Web Gallery into a non-flash format? In my site I am trying to pay particular attention to accessibility and flash is inherently non-accessible, and also does not work with some of the most popular mobile devices (iPad, iPhone, iAnything). Essentially I am looking for some kind of HTML5 Web Gallery. Any help would be greatly appreciated.

    Hi there -
    I'd try posting your question over in the Flash general forum. You could also try the Flash site design forum. The folks over there will probably be able to help you solve your issue

  • Cfgrid not displaying in flash format

    <cfform format="flash" width="1000"
    action="editContact.cfm">
    <cfgrid name="contact" query="contact_details"
    selectmode="edit" insert="yes" delete="yes" height="200"
    width="1000" align="middle">
    <cfgridcolumn name="ID" display="no">
    <cfgridcolumn name="FIRST_NAME">
    <cfgridcolumn name="LAST_NAME" >
    <cfgridcolumn name="JOB_TITLE">
    <cfgridcolumn name="EMAIL" >
    <cfgridcolumn name="PHONE">
    </cfgrid>
    <br>
    <cfinput type="submit" value="submit" name="submit">
    </cfform>
    Hi, the code above using cfgrid in flash format used to
    display perfectly. But after some time, without changing the code,
    cfgrid is not displaying anymore. Any reasons why this is
    happening? Thanks.

    What error do you see? Anything?
    Try tracing the page request by using coldfusion/jrun's
    sniffer.exe,
    Charles, or some other
    tool. See what is going on. If the applet is starting to load,
    enable the java console and review the errors there.
    Does this issue happen on multiple client machines or just
    one? What version of CFMX7 are you using (run sysinfo from
    cfadmin).

  • How do I insert a movie in Flash format?

    How do I import or insert a movie in Flash format to
    Fireworks? Because I had no problem doing so with image files, but
    when I try to import the .swf file, it brings "All readable
    files"and .swf are not included. Please I am in a hurry with this,
    help me.

    admaldo wrote:
    > How do I import or insert a movie in Flash format to
    Fireworks?
    You can't. You need to do that in Dreamweaver.
    Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    http://www.adobe.com/communities/experts/

  • I NEED HELP! Making a flash email form using php.

    Hi, my name is Sean, I'm making a flash contact form using php for a website.
    I'm having a hard time with the php. Can some one help?
    Click here to download my source.

    Satellite A505-S6005 
    ACPI Flash BIOS version 1.40 for Satellite A500/A505 (PSAT6U/PSAT9U)
    When you execute the download file (sat6v140.exe) it decompresses into several files in the sat6v140 folder. 
    Among those, is the readme.txt attached, which explains how to create the CD.
       Burn a CD or DVD from an ISO file
    -Jerry
    Attachments:
    readme.txt ‏14 KB

  • Validation errors detected in form. when running a task

    Hi All,
    We are working on a large scale deployment that involves creating, modifying, deleting, etc. users utilizing ActiveSync processing in Sun IdM 7.1
    But for some reason, everytime we run a user through ActiveSync processing, we are receiving the following error message:
    com.waveset.exception.FormValidation: Validation errors detected in form.
    My guess is that either the ActiveSync form is corrupted or maybe the default user form.
    I have rolled back to prior versions of our custom ActiveSync form, but it has not solved the problem. I have checked the ActiveSync logs looking for a missing required field, but no errors show up there.
    I cant seem to find the form that this validation error is occuring on. I have tracing set up on level 4, and it doesnt seem to point me in the right direction.
    Any advise or experience with this error message would be greatly appreciated.
    Thanks

    I have the similar problem. Do you have solution yet?
    com.waveset.exception.FormValidation: Validation errors detected in form.
    +     at com.waveset.util.WavesetException.checkBreakpoint(WavesetException.java:366)+
    +     at com.waveset.util.WavesetException.<init>(WavesetException.java:85)+
    +     at com.waveset.exception.FormValidation.<init>(FormValidation.java:39)+
    +     at com.waveset.object.ViewMaster.runExpansions(ViewMaster.java:981)+
    +     at com.waveset.server.ViewMaster.runExpansions(ViewMaster.java:626)+
    +     at com.waveset.object.ViewMaster.runExpansions(ViewMaster.java:941)+
    +     at com.waveset.object.ViewMaster.checkinView(ViewMaster.java:723)+
    +     at com.waveset.session.LocalSession.checkinView(LocalSession.java:709)+
    +     at com.waveset.ui.util.GenericViewSource.checkinView(GenericViewSource.java:522)+
    +     at com.waveset.ui.util.GenericEditForm.process(GenericEditForm.java:593)+
    +     at com.ibm._jsp._wsibupdateprofile_5F_workItemEdit._jspService(_wsibupdateprofile_5F_workItemEdit.java:470)+
    +     at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:91)+
    +     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)+
    +     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1572)+
    +     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1521)+
    +     at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)+
    +     at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)+
    +     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:759)+
    +     at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:121)+
    +     at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:204)+
    +     at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:89)+
    +     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1924)+
    +     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)+
    +     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)+
    +     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)+
    +     at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)+
    +     at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)+
    +     at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)+
    +     at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)+
    +     at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)+
    +     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1471)+

  • How to write database validations in Adobe flex form for web Dynpro

    Hi,
    Can any one help me
    How to write database validations in Adobe flex form for web Dynpro
    Please provide some documents if u have
    Thanks in advance
    D babu

    Hi Thomas Jung  ,
    Thanx for reply.
    I will explain my requirement
    I have vendor field in flex  if  i enter vendor no in flex I am biding this field to web dynpro context field I am getting this value in dynpro .
    With this value I am checking in my SAP database if i donu2019t  get I have to through an error in flex .
    Please tell me how to through an error to flex.

  • Flash contact form key issue

    Hi my flash contact form will only accept certain keys, Like zxvywghjk.. and number keys will not type into it any ideas???
    motionstills.co.uk

    Forms in Flash use Input text objects. You have to embed the font or fonts that you want to use for those text objects. It sounds like either you embedded a font that doesn't contain a full set of glyphs or that a restricted set of glyphs was set in the Font Embed window.

Maybe you are looking for