• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

Problems with URL search string

I have a form with a hidden field:
<input type="hidden" id="my_value" name="value" value="" />

Open in new window

This field uses a value given by some javascript,  
document.getElementById('my_value').value = value;

Open in new window

value is a variable which is given a numeric value depending on how the form is filled in. This appends 'value = ..' and whatever value 'value' holds at the time.

All the above works with no issue.

I am now trying to do the same again, but for a different form on a different page. I have my hidden field:  
<input type="hidden" id="my_fees" name="fees" value="" />

Open in new window

I have my javascript:  
document.getElementById('my_fees').fees = fees;

Open in new window

This does not work, the string always shows fees as 'fees=' and no value. Even if I give fees a value and remove any code that changes the value of fees in the script, so I have:  
function passenger_validation() {
	var fees = 699;

other code removed

Open in new window

the string will always show 'fees='

Let me know if you need more code, or can spot some obvious flaw i've been blinded to in the second lot of code.

1 Solution
Paul JacksonCommented:
change :
document.getElementById('my_fees').fees = fees;
document.getElementById('my_fees').value = fees;
Lexx877Author Commented:

I just confused myself by having value as...value. Sigh. Of course that's why it wasn't working!

Well that's why I came here a fresh pair of eyes always helps :)

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now