You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chen, Dean (Zhun)" <De...@gs.com> on 2002/08/23 17:25:15 UTC

JavaScript problem vs. LookupDispatchAction

Hi,
I tried to get lookupdispatchaction to work, but it kept on giving me
errors.

Then I tried dispatch action with javascript, however, I'm getting a
JavaScript "Object doesn't support this property or method" error. I can't
figure this out.

Here's the code within <head>
<SCRIPT LANGUAGE=JavaScript>
<!--
var state = false;
function pressedButton(btn)
{
	if(!state)	{
		var name = btn.name;
		var value = btn.value;

		document.forms[0].dispatchMethod.value = name;

		btn.disabled = true;
		document.forms[0].submit();
		
		state=true;
		return true;
		
	}
	else
	{
		return false;
	}

}
//-->
</SCRIPT>

<INPUT TYPE="SUBMIT" NAME="refreshMethod" VALUE="Refresh Me"
onclick="javascript:pressedButton(this)">

Everything works fine except "document.forms[0].submit();" which gives the
above error. What am I doing wrong? Is there something I'm overlooking?  

Thanks,

Dean Chen


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>