function updateCC(rowNum) {
       document.prices("cc" + rowNum).value = document.prices("cost" +
rowNum).value * 1.2;
}

But it's widely considered better practice to use document.getElementById()
rather than document.formname to reference form fields. To do so, just ad
id="" to the fields, and the function would become:

function updateCC(rowNum) {
       document.getElementById("cc" + rowNum).value =
document.getElementById("cost" + rowNum).value * 1.2;
}

On 11/7/07, James Smith <[EMAIL PROTECTED]> wrote:
>
> Quick question I am sure someone will answer in no time...
>
> How do I modify the function...
>
> function updateCC(rowNum) {
>        document.prices.cc1.value = document.prices.cost1.value * 1.2;
> }
>
> So that if 'rowNum' is 4 then 'cc1' becomes 'cc4' and 'cost1' becomes
> 'cost4'.
>
> --
> Jay
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.15.23/1114 - Release Date:
> 06/11/2007
> 20:05
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:245991
Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5

Reply via email to