Thanks again!

About the value (Question 3) I just wasn't sure I could use OGNL when
writing JavaScript but Ok. I get it.

I also found this example:
http://www.developertutorials.com/tutorials/javascript/change-form-field-values-050522/page1.html

The only thing that's left to fix now (I think) is finding a way to
reference the form field correctly. I have Not found this in any
tutorial.
It seems like it should be something like:

xxxxx.NameOfForm.NameOfHiddenField.value = INPUTVAL

The part that I called "xxxxx" is the part that I don't understand.
Should it be the name of the JSP or what?

/Ylva

On Fri, Aug 29, 2008 at 8:54 PM, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- On Fri, 8/29/08, Ylva Degerfeldt wrote:
>> Basically, I need to know 3 things:
>> 1. Does the code have to be in a JS method or can it be
>> "right under onclick"?
>
> Doesn't matter, but since you have to both set the form field and submit the 
> form it's likely to be cleaner to put it in a JavaScript method. Matter of 
> preference.
>
>> 2. How do I set the reference to the hidden field in JS?
>
> Any JavaScript/DOM tutorial/documentation will explain that.
>
>> 3. How do I set the value of (1) to the value of #state.index
>> in JS? (Do I keep the '#', do I need %{ } or what?)
>
> Not sure what you mean here; you'd use standard OGNL syntax:
>
> <s:submit ... onclick="return foo(%{#state.index})" ... />
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to