I use cfform with cflayout and 2 tabs.
In the form, in tab1, I have a cfinput that is marked as "required".

I do not enter any data in the form to test the "required" validation by cfform.
When I am on the first tab, and clic on "save" button, cfform works fine, opens 
a window error, and stays in the form.

But if i go to the second tab, and clic on save button, i get the error window, 
but coldfusion submits the form to the server.

Example : test.cfm :
                
<cfform name="form1" action="save.cfm" method="post" format="html">
<cflayout type="tab" name="lay1">
<cflayoutarea name="tab1" title="tab1">
        <cfinput name="loc_a" type="text" id="loc_a" required="true">
</cflayoutarea>
<cflayoutarea name="tab2" title="tab2">
        Lorem ipsum
</cflayoutarea>
</cflayout>
<cfinput type="submit" name="Save" value="Save">
</cfform>

Go to tab2, clic Save : you get the window error, but cfform still submits the 
form.

Do you see any way to correct this ?

I did a "view source" in the browser, and found that by disabling 2 generated 
lines, It would work :
            if( _CF_error_messages.length > 0 )
            {
                // show alert() message
                _CF_onErrorAlert(_CF_error_messages);
                // set focus to first form error, if the field supports js 
focus().
                if( _CF_this[_CF_FirstErrorField].type == "text" )
                { _CF_this[_CF_FirstErrorField].focus(); }

            }
            return false;

If I disable the 2 lines on the focus :
                // if( _CF_this[_CF_FirstErrorField].type == "text" )
                // { _CF_this[_CF_FirstErrorField].focus(); }
then it works fine, the form is not submitted.

Do you know any way to tell CF to not generate these 2 lines ?

Thanks in advance for any help.
Firmus.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296106
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to