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 =/


  • 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
    the Netherlands...
Sign In or Register to comment.

Howdy, Stranger!

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


In this Discussion