Problems with URL search string

Posted on 2011-04-21
Last Modified: 2012-05-11
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.

Question by:Lexx877
    LVL 29

    Accepted Solution

    change :
    document.getElementById('my_fees').fees = fees;
    document.getElementById('my_fees').value = fees;
    LVL 1

    Author Comment


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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
    The viewer will learn how to dynamically set the form action using jQuery.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now