struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alfors, Peter" <palf...@delphion.com>
Subject RE: JavaScript problem vs. LookupDispatchAction
Date Fri, 23 Aug 2002 16:05:18 GMT
you do not need to use a SUBMIT input since you are using javascript to 
submit the form.

try using a BUTTON instead.

Also, it would be helpful to see the form section that is being submitted.


-----Original Message-----
From: Chen, Dean (Zhun) [mailto:Dean.Chen@gs.com]
Sent: Friday, August 23, 2002 10:25 AM
To: 'Struts Users Mailing List'
Subject: 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:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message