here's a $64,000 answer:

use jQuery!

tested proof of concept:

=====testpage.cfm code:=====
<!--- the script below utilizes jQuery ajax features. must have jQuery. --->
<head>
<script src="path/to/your/jquery.pack.js" type="text/javascript"></script>
<script type="text/javascript">
saveform = function(){
    $.post('saveform.cfm', $("form").serializeArray(), function(data){
alert(data); });
    return false;
}
</script>
</head>
<body>
<!--- note that both text fields are required, but using jQuery.post
does not fire cf validation --->
<p>Enter something into t1 field and click Save button</p>
<cfform name="form1" action="" method="post">
t1: <cfinput type="text" name="t1" value="" required="yes"
message="Enter something in t1 field!"><br />
t2: <cfinput type="text" name="t2" value="" required="yes"
message="Enter something in t2 field!"><br />
<cfinput type="submit" name="submitbtn" value="save" onClick="return
saveform();" >
</cfform>
</body>

=====saveformpage.cfm code:=====
<!--- this page returns back the value of form.t1 just for testing. you
can loop over the form.fieldnames and save the form data wherever you
want to... --->
<cfif isdefined('form')>
    <cfif structkeyexists(form, 't1')>
        <cfoutput><cfif len(trim(form.t1))>#form.t1#<cfelse>t1 field is
empty...</cfif></cfoutput>
    <cfelse>
        <cfoutput>t1 field does not exist in the form scope!</cfoutput>
    </cfif>
<cfelse>
    <cfoutput>No Form scope exists!</cfoutput>
</cfif>


note that both text fields in the form are set required="yes", but cf
validation never fires!

now, where do i collect the prize??? :)

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Gonzo Rock wrote:
> I have a form with many <cfinput tags and it works very well for a number of
> years.
> Now I need to add a new ability to the form.  I want to add a second submit
> button that
> will submit the form but without firing off the <cfinput checks.
>
> When the new submit button is clicked the routine will accept whatever is in
> the form, without the <cfinput checks, for temporary storage... until at
> some later time the user reloads it and finally commits all the data by
> choosing the original submit button, at which time the checks will be sure
> everything is correct.
>
> So far the second submit button works and I can detect it and process
> differently however, the <cfinput code is still firing if the form data
> isn't perfect and I can't think of a way to turn it off.
>
> Changing the core cf routines that populate the page with the _cf_check
> script is not an option unfortunately.
>
> any ideas?
> thanks
>   

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

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315129
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to