<form name="whatever" action="somepage.cfm" method="POST">
<select name="quantity" onChange="submitForm()">
<option value="">Select a quantity</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<input type="hidden" name="ID" value="#Product.ID#">
</form>
function submitForm()
{
if
(document.whatever.quantity.options[document.whatever.quantity.selectedIndex].value
!= "")
{
// they've chosen an option that's not blank
document.whatever.submit();
}
}
somepage.cfm:
<cfparam name="Form.quantity" default=0>
<cfparam name="Form.ID" default=0>
<cfquery name="updateQuantities" datasource="dsn">
UPDATE Product
SET Quantity= #Form.quantity#
WHERE ID = #Form.ID#
</cfquery>
<cflocation url="someotherpage.cfm">
"Paul Swingewood"
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
tmail.com> cc:
Subject: [ cf-dev ] OnChange?
08/07/2004 16:28
Please respond to
dev
Can anyone help me with this one please.
I want to have a drop down list (quantity)
When the user changes the quantity I want to update the qnty field in the
table orders.
How do I do this?
Any ideas?
Regards - Paul
--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided
by activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by
proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by
gradwell.com*
To unsubscribe, e-mail: [EMAIL PROTECTED]
--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by
activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*
To unsubscribe, e-mail: [EMAIL PROTECTED]