Hmm. As there are three items ont the form that the user could change I
think i'll stick with the button as you suggest. It just doesn't look as
nice ... :(
Regards - Paul (Amazed there are no wise cracks about the shoes yet)
From: [EMAIL PROTECTED]
Reply-To: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Re: [ cf-dev ] OnChange?
Date: Thu, 8 Jul 2004 17:09:23 +0100
not like this. e.g. if trying to enter "1234", that registers as 4
onChange events. You'd be better using onBlur, which is the event
triggered after this field loses focus. Although to be honest, that could
be annoying, especially if you're not finished editing the page. you might
just have clicked into the field, then clicked elsewhere to change
something else - the form would submit when you click outside of the box.
better to use a button to submit it - the drop-down select is better for
doing the automatic submission as it assumes you've made a change to the
field. it would also work with radio buttons, but not really any other
form fields.
you're better off keeping the javascript to a minimum and just letting the
user click a button when they're done.
"Paul Swingewood"
<[EMAIL PROTECTED] To:
[EMAIL PROTECTED]
tmail.com> cc:
Subject: Re: [ cf-dev ]
OnChange?
08/07/2004 17:04
Please respond to
dev
Excellent!
Can the same be done for a texbox?
<input type="Text" name="Quantity#Replace(ItemIDPK,"-","_","ALL")#"
value="#Quantity#" align="RIGHT" size="3" onChange="submitForm()">
This would give an infinate number of possible quantities ...
Regards - Paul
>From: [EMAIL PROTECTED]
>Reply-To: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: Re: [ cf-dev ] OnChange?
>Date: Thu, 8 Jul 2004 16:44:17 +0100
>
>
><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]
>
--
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]
--
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]