aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Dynamic Form Element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Dynamic Form Element" Watch "Dynamic Form Element" New topic
Author

Dynamic Form Element

Nandhini Sridharan
Ranch Hand

Joined: Oct 26, 2006
Posts: 36
Hi,

I have a form element say textfield and name of that text field is say quality_03. the 03 is calculated dynamically. Finally I would like to assign a value for that text field say.,

form.quality_03.value=3

var numVal=03 // Its calculated in loop I have given this for an example.

For this I have used

var txt = form."quality"+"_"+numVal.value
var txt=3

But it didnt accept. It shows the error as txt not object. Can someone help me out with this one. I need this very urgently. I have deployment tonight.

Regards,
Nandhini.
[ November 29, 2006: Message edited by: Bear Bibeault ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
document.forms[0].elements["foo" + bar].value

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic Form Element
 
Similar Threads
Problem with carrying over the correct months while using GetDate()
Trying to extract text portion of select statement entry
Javascript Calculation Rendered value
Validate multiple fields base on a requiredif
Struts Validator FrameWork = JavaScript Error