Link to home
Start Free TrialLog in
Avatar of Lexx877
Lexx877

asked on

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.

Alex
ASKER CERTIFIED SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lexx877
Lexx877

ASKER

Hah!

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 :)