Hi Will,
I never use <cfform>, but I think you can apply the idea that I'll be sharing
to you to <cfinput>. Suppose you have two files, billing.cfm and shipping.cfm.
The user enters his billing info in billing.cfm, and submits it to
shipping.cfm.
Suppose you have the following input in billing.cfm:
<input type="checkbox" name="address" id="address" />
In shipping.cfm, you simply do this in order to insert the values that were
entered in billing.cfm (assuming that the info was passed via GET):
<cfoutput>
<input type="checkbox" name="address" id="address"
value="#HTMLEditFormat(URL.address)#"
/>
</cfoutput>
However, based on your question, I assume that you wish to add the info
whenever a user clicks the checkbox. Well, use ColdFusion in tandem with
JavaScript. Here's an improved version of shipping.cfm:
<html>
<head>
<cfoutput>
<Xcript>
// <![CDATA[
function populate() {
if(document.foo.blah.checked) {
document.foo.ewan.value = "#HTMLEditFormat(URL.address)#";
} else {
document.foo.ewan.value = "";
}
}
// ]]>
</Xcript>
</cfoutput>
</head>
<body>
<form name="foo" id="foo">
<input type="checkbox" name="blah" id="blah" onClick="populate()" />
Use info<br />
<input type="text" name="ewan" id="ewan" />
</form>
</body>
</html>
Please note that I used "Xcript" instead of "script" because House of Fusion
filters my post. Just replace them as needed. :)
Cheers,
[ simon.cpu ]
> In my cart app there's the billing/shipping info page. I'm using
> cfform.
>
> Is there a way to make my "use billing info for ship to info" checkbox
> automatically insert the values that were entered in the billing part
> into the ship to cfinputs?
>
> Thanks,
Will
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207837
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54