On 18 Oct 2004 10:21:20 -0700, Ryan Gaffuri <rg******@cox.net> wrote:
[snip]
I tried the following and nothing worked.
document.formname.xmlfield.value = val
I also tried naming my form:
<FORM name=ADDRESSBOOK>
dont know if i need to name it when i do </FORM>
No. Attributes only appear in the starting tag of an element.
Perhaps you should try validating your page
(<URL:http://validator.w3.org/>). Being unsure of something so basic
suggests you should revisit some HTML basics.
then did:
document.ADDRESSBOOK.xmlfield.value = val
Without actually seeing your page, it's diffcult to say what's wrong.
Nothing this simple should be so hard to solve. If you still need help in
this thread, please post your mark-up and the relevant script code.
Preferably this should be in the form of a simplified page, posted
somewhere on the Web. If that isn't possible, the same should be copied
and pasted in a post.
this is what i am trying to do. I have a form. When a certain button is
pressed. I want to pass a value back to my java servlet. I thought the
best way to do it was to use a hidden field and set that with a button.
then i can retrieve it on the servlet side.
From that description, and what you've posted, there's no need for
scripting at all.
Submit buttons, just like any other control, will submit a name/value pair
if the browser considers it a "successful control". There are two ways to
implement this: with a BUTTON element, or an INPUT element with type
"submit". The former will allow cleaner server-side processing, but it
won't work at all with NN4. The latter will work with all browsers, but it
will require changes to your server-side code.
<button type="submit" name="xmlfield"
value="XML">Display XML</button>
or
<input type="submit" name="xmlfield" value="Display XML">
You'll immediately notice that the two values to be submitted are
different. The problem with the INPUT element is that it's value is also
the text displayed.
Whichever of the two you'll choose, either will be a far better solution
than making your page reliant on script support.
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.