You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2006/09/12 16:36:33 UTC

LookupDispatchAction call - onchange of an input field

Have a html:text . onchange of the value entered in this field, have to 
submit the form.

Using LookupDispatchAction.

<script>
function onNumChange(numObj)
        document.forms[0].method.value="numPay";
        document.forms[0].submit();
}
<script>

<html:hidden property="method"/> // used for LookupDispatchAction

<html:text name="Form1" styleId="numID" property="numPay" 
onchange="onNumChange(this);"/>

IS it possible to submit a form onchange of a input field? the above is not 
working. How can this be done?

Thanks.

_________________________________________________________________
Get real-time traffic reports with Windows Live Local Search  
http://local.live.com/default.aspx?v=2&cp=42.336065~-109.392273&style=r&lvl=4&scene=3712634&trfc=1


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: LookupDispatchAction call - onchange of an input field

Posted by Puneet Lakhina <pu...@gmail.com>.
On 9/12/06, fea jabi <zy...@hotmail.com> wrote:
>
> Have a html:text . onchange of the value entered in this field, have to
> submit the form.
>
> Using LookupDispatchAction.
>
> <script>
> function onNumChange(numObj)
>         document.forms[0].method.value="numPay";
>         document.forms[0].submit();
> }
> <script>
>
<html:hidden property="method"/> // used for LookupDispatchAction
>
> <html:text name="Form1" styleId="numID" property="numPay"
> onchange="onNumChange(this);"/>
>
> IS it possible to submit a form onchange of a input field? the above is
> not
> working. How can this be done?
>
> Thanks.
>
Please specify what do you mean by "not working"?? is the java script being
called?
Or is the method value not coming?
In case you are using tiles, document.forms[0] might be referring to some
other form. you should use the form name instead.

-- 
Puneet