Hmmm. Not working... Does selOpt need another name, dynamic name?

-----Original Message-----
From: Che Vilnonis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 28, 2006 4:46 PM
To: CF-Talk
Subject: RE: Javascript and Dynamic CF Forms


Geez. That was fast. Thanks... Testing now...


-----Original Message-----
From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 28, 2006 4:42 PM
To: CF-Talk
Subject: Re: Javascript and Dynamic CF Forms


<select name="Comments#getLineItems.CurrentRow#"
onchange="updateText(#getLineItems.currentRow#, 'this.value');">

<script type="text/javascript">
     function updateText(n, selOpt) {
          if (selOpt == "OUT OF STOCK") {
               document.formName.elements["QTYShipped" + n].value = 0;
          }
     }
</script>

On 12/28/06, Che Vilnonis <[EMAIL PROTECTED]> wrote:
> I have a form with a varied number of form fields (they are
> dynamically created). Two of the form fields are a input box and a 
> select box. I loop through my query and define the form names like so:
>
> <input type="text" name="QTYShipped#getLineItems.CurrentRow#"
> value="1" size="4" maxlength="3">
>
> and
>
> <select name="Comments#getLineItems.CurrentRow#">
> <option value="SHIPPED">SHIPPED</option>
> <option value="SHIPPED AVAILABLE">SHIPPED AVAILABLE</option> <option
> value="DISCONTINUED">DISCONTINUED</option>
> <option value="OUT OF STOCK">OUT OF STOCK</option>
> </select>
>
> How can I, using Javascript, use an onChange event so that when "OUT
> OD STOCK" is selected from the pulldown, the text value is auto 
> changed from 1 to 0. I am getting hung up with the dynamic form names 
> and declaring them in my javascript function.
>
> Hope this makes sense? Che
>
>
> 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265252
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