Modifying values between forms

    Date: 07/04/05 (Javascript Community)    Keywords: no keywords

    I have a page where I usually grab size information about a product from a object.

    Two different forms on my page need this one value, and I use onChange when it's a select to set the value in my other form. This is happy. However, I'm having trouble getting the object to reset itself properly. For the input object, I'm using onClick at the submission point, and I'm not even sure it's being called.

    Can anyone see anything obviously wrong?

    function get_selected_option() {
    document.form1.size.value =
    unescape(document.form2.size.options[document.form2.size.selectedIndex].value);
    # This next bit is what's not working...
    if (document.form1.size.value == "invalid") {
    document.form1.size.value = unescape(document.form2.size.value); }
    return TRUE; }

    Here's my onChange (which works):
    # form 2


    # form 2



    form2.size.value is always "invalid" after I click on the form 2 submit button. I'm perplexed.

    Thanks for any help you can offer,
    -k.

    Source: http://www.livejournal.com/community/javascript/70906.html

« Javascript || multiple select box problem »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home