Jump to content

[SOLVED] in IE .value works, in Netscape not


Jim from Oakland

Recommended Posts

phreaks

I am a total hacker in javascript!  In IE I get the value of a hidden input as shown.  In Netscape the last statement chokes. What syntax might I try?

pItemIndex = 1;
sValueFieldName = 'Item' + pItemIndex + 'Price';
oValueField = document.getElementById(sValueFieldName);
dValue = oValueField.value;
Link to comment
https://forums.phpfreaks.com/topic/33107-solved-in-ie-value-works-in-netscape-not/
Share on other sites

fenway

Thanks for offering to assist.  I'm not sure how to be more clear. That is the exact code.  It is in a longer js function that does the same thing several times. The entire funciton works fine in IE but in Navagator it does not.

I am merely looking to get the value from a hidden input field. In my example the hidden field name is Item1Price
<input type="hidden" name="Item1Price" value=12.99>

How do I retrieve the value 12.99?

Note: pItemIndex is an integer.
Thanks again fenway!

Need id Indeed!  I typed the example hidden input tag in the previous post rather than say copying it from the html source.  Here is what I have in the html source.

<INPUT type="hidden"
name="Item1Price"
id="Item1Price"
value=60.5>

<INPUT type="hidden"
name="Item1Qty"
id="Item1Qty"
value=0>

I am NOT using a form, just a few input (events) that js responds to. Might that be THE solution?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.