Skip navigation
Currently Being Moderated

Accessing form elements in javascript

Nov 23, 2011 8:44 PM

Hi,

 

I am new to coldfusion. I hope you can help me out.

 

I am using cold fusion flash forms. I have dynamically created text boxes(cfinput) in the form with name amount_#count#.where count varies from 1 to n(returned by a DB Query).

 

My problem is, when I click on a button, I have to recalculate the contents inside it and update the value. As the form is a flash form I am using Cfscript tag for writing java script. I know document.getelementbyid won't work in cfsript.

 

I trief FormName['amount_"+i]. It gives me the value of the text box. But when I try FormName['amount_"+i] = 'New Value'. This is comming when I submit the form, but it is not getting reflected in the UI. I know amount_1.text = 'New Value' will update it. But I cannot directly give 1 in the name.

 

Any way out? Please help!

 

Anjana

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points