You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by kalyan namburi <nv...@gmail.com> on 2007/02/25 14:05:58 UTC
form submission problem
hi,
i have a drop down list which contains services available.
when you select any option from it calls the doSubmit method in javascript
<% String submitString = "doSubmit('" + SELECT_SERVICE + "');"; %>
The doSubmit is as below
function doSubmit(actionString){
alert(actionString);
currentForm = document.forms[0];
currentForm.actionName.value = actionString;
alert(currentForm.actionName.value);
currentForm.submit();
}
The first alert is displaying SELECT_SERVICE but select alert is not
reached. Even empty alert box is not coming
So it is not assigning actionString value to the form attribute actioName.
Even when i click any button in the jsp the first alert is showing the value
but not the second. happening. The page is remaining as it is. Not even
showing any error.
so anybody out there please advice where i went wrong
Thanks,
kalyan
Re: form submission problem
Posted by Nuwan Chandrasoma <my...@gmail.com>.
hi,
i think the error is in your javascript, is there a form field called
actionName in your form?, try altering your javasript like this and see
function doSubmit(actionString){
alert(actionString);
currentForm = document.forms[0];
alert(currentForm);
alert(currentForm.actionName);
currentForm.actionName.value = actionString;
alert(currentForm.actionName.value);
currentForm.submit();
}
Regards,
Nuwan.
----- Original Message -----
From: "kalyan namburi" <nv...@gmail.com>
To: <us...@struts.apache.org>
Sent: Sunday, February 25, 2007 1:05 PM
Subject: form submission problem
> hi,
>
> i have a drop down list which contains services available.
> when you select any option from it calls the doSubmit method in javascript
>
> <% String submitString = "doSubmit('" + SELECT_SERVICE + "');"; %>
>
> The doSubmit is as below
>
> function doSubmit(actionString){
> alert(actionString);
> currentForm = document.forms[0];
> currentForm.actionName.value = actionString;
> alert(currentForm.actionName.value);
> currentForm.submit();
> }
>
> The first alert is displaying SELECT_SERVICE but select alert is not
> reached. Even empty alert box is not coming
>
> So it is not assigning actionString value to the form attribute actioName.
> Even when i click any button in the jsp the first alert is showing the
> value
> but not the second. happening. The page is remaining as it is. Not even
> showing any error.
>
> so anybody out there please advice where i went wrong
>
> Thanks,
>
>
> kalyan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org