Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conversion Problem 1

Status
Not open for further replies.

1Data

MIS
Sep 30, 2005
66
US
I apologize upfront for this question...but my brain is not working properly this morning...

I have a "statement" that I need to be excuted.

strbidunitprice = "form1.bidunitprice1" & index & ".value"

Now I need to attach this value to another object. But of course its value is the literal "form1.bidunitprice1-1.value" not the value from my form..I've been looking for some function to do this and I can't find it.

Thanks in advance
 
You could use
Code:
strbidunitprice = form1.elements['bidunitprice1' & index].value

Lee
 
Change the single quotes to double quotes, though. Too much time spent in the Javascript forum, I guess. :)#

Lee
 
elements" is that a function. I ask cause it doesn't work.
 
Okay, let me try this again in VBScript rather than Javascript. Sorry about that.

Code:
strbidunitprice = form1.elements("bidunitprice1" & index).value
[code]

[b]elements[/b] is an array of the different inputs in a form, and they can be accessed in the array by the name of the individual element.

Just so you know, if you have this on a web page that will be viewed by anyone who isn't using Internet Explorer, your VBScript code won't work.  It's for IE only.  You'll need to use Javascript to make your code universally workable.

Lee
 
I know that about IE...its an intranet app no one will be using anything but IE. Thanks LEE that works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top