MyForm [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => bforce [ip] => bforce@poultrye [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> > > > > MyForm > >[/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => bforce [ip] => bforce@poultrye [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> cfinput required="yes" and inline javascript conflict - Coldfusion - Advanced Techniques

cfinput required="yes" and inline javascript conflict - Coldfusion - Advanced Techniques

Has anyone experienced a situation where inline Javascript is causing Cold Fusion's native error reporting to fail. I have a script that tests 2 select boxes to make sure the user has selected a value, if not, generate an alert. My regular cfinput fields are set to required="yes" message="myMessage". But if I have an onSubmit function in tag <CFFORM>, the form will submit and no alert will be generated for the required cfinput fields. Take out the onSubmit function and CF alerts as expected. I started noticing this after upgrading to CF 7. Below is my code: <script language="javascript" type="text/javascript"> ...

  1. #1

    Default cfinput required="yes" and inline javascript conflict

    Has anyone experienced a situation where inline Javascript is causing Cold
    Fusion's native error reporting to fail. I have a script that tests 2 select
    boxes to make sure the user has selected a value, if not, generate an alert.
    My regular cfinput fields are set to required="yes" message="myMessage". But
    if I have an onSubmit function in tag <CFFORM>, the form will submit and no
    alert will be generated for the required cfinput fields. Take out the
    onSubmit function and CF alerts as expected. I started noticing this after
    upgrading to CF 7. Below is my code:

    <script language="javascript" type="text/javascript">
    <!--
    function CheckForm() {
    if (doent.forms[0].Country.selectedIndex < 1) {
    alert("Please select a country.");
    return false;
    }
    else if (doent.forms[0].STATE1.selectedIndex < 1) {
    alert("Please select a state.");
    return false;
    }
    }
    //-->
    </script>

    <cfform name="form" action="mreg_pck.cfm" method="post" onSubmit="return
    CheckForm();">
    MyForm
    </cfform>


    bforce Guest

  2. #2

    Default Re: cfinput required="yes" and inline javascript conflict

    Also - Does anyone know what's up with cfxchange.com? Bought a custom tag
    from them yesterday and the site broke. Never go the tag and thier site is
    down today. I thought it was a pretty active site for CF developers but all
    of the posts in thier forum look to be at least a year old. Hope I didn't
    get ripped!


    "bforce" <bforcepoultryegg.org> wrote in message
    news:d5gf4e$70o$1forums.macromedia.com...
    > Has anyone experienced a situation where inline Javascript is causing Cold
    > Fusion's native error reporting to fail. I have a script that tests 2
    > select boxes to make sure the user has selected a value, if not, generate
    > an alert. My regular cfinput fields are set to required="yes"
    > message="myMessage". But if I have an onSubmit function in tag <CFFORM>,
    > the form will submit and no alert will be generated for the required
    > cfinput fields. Take out the onSubmit function and CF alerts as expected.
    > I started noticing this after upgrading to CF 7. Below is my code:
    >
    > <script language="javascript" type="text/javascript">
    > <!--
    > function CheckForm() {
    > if (doent.forms[0].Country.selectedIndex < 1) {
    > alert("Please select a country.");
    > return false;
    > }
    > else if (doent.forms[0].STATE1.selectedIndex < 1) {
    > alert("Please select a state.");
    > return false;
    > }
    > }
    > //-->
    > </script>
    >
    > <cfform name="form" action="mreg_pck.cfm" method="post" onSubmit="return
    > CheckForm();">
    > MyForm
    > </cfform>
    >

    bforce Guest

  3. #3

    Default Re: cfinput required="yes" and inline javascriptconflict

    I had the same problem with calling javascript from the onsubmit attribute in
    the cfform tag when trying to validate a field in the form. I got around this
    by using the onvalidate attribute of the cfinput or cfselect or any other cf
    form type tag. But I don't think you have to use it on the form you provided.
    Here is what I would do with your form:

    <cfform name="form" action="mreg_pck.cfm" method="post">
    <cfselect query="GetCountries" name="Country" display="country_name"
    value="country_code" required="yes" message="A country is required">
    </cfselect>
    <cfselect query="GetStates" name="STATE1" display="state_name"
    value="state_code" required="yes" message="A state is required">
    </cfselect>
    </cfform>

    Hope this helps, but let me know if you were looking for something else!

    CF_DAWG Guest

Similar Threads

  1. "Page" and "Rect" props of the Field prop in Javascript API
    By ArtIn_Act@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 8
    Last Post: March 19th, 05:35 PM
  2. how i use <cfinput type="file" ...> in cfformtype="flash
    By Prashantgenial in forum Coldfusion Flash Integration
    Replies: 1
    Last Post: June 26th, 11:04 PM
  3. CFINPUT type="radio" w/ "value" requires "label"
    By Iceborer in forum Macromedia ColdFusion
    Replies: 2
    Last Post: February 21st, 06:16 PM
  4. Replies: 0
    Last Post: July 18th, 11:51 PM
  5. Replies: 0
    Last Post: July 10th, 10:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •