document.form.input.value not staying - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

document.form.input.value not staying

Hey, I've used the document.value command/script loads in previous sessions, but I can't see what is going on with this one.

##In the head section inside a tag###

function submit_wepname()
{
document.info_gather.weapon_name.value = preset_wepnames.dropdown_wep_choice.value;
}



##In the body section##







When the javascript function is run (via a submit button) it works and the input value in the form changes to the appropriate value, but it then instantly flicks back to the default value (test1). Even if i put value="" it just flicks back to an empty input box. Any ideas? I'm guessing it's a simple thing that I'm gonna kick myself about =/

Comments

  • mac_doggiemac_doggie Posts: 488Member
    You'd better not post the form but instead just do your actions in the onclick of a normal button or link. If you submit your form it is seen as new request. The page resets itself (unless your browser saved the values of your input fields)

    just do something like do it
    ;-)
    -mac-
    mailto:mac_doggie@hotmail.com
    the Netherlands...
Sign In or Register to comment.