hi michelle,
i see a main difference between your struts version and your non-struts
version. on the struts version you have forms[0] referencing your form and
on the second one you have forms[1].
the secure way to talk to forms by JavaScript is to reference the form by
name.
document.formName.submit();
or
document.formName.elementName.value = "something";
hope this will help you.
norman
----- Original Message -----
From: "Michelle Popovits" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 11:19 PM
Subject: unable to programmatically perform a submit
Hi,
I am trying to get an image map working that does a submit.
The image map itself works.
However, when I click on the image area it complains when trying to execute
the submit.
Error: object doesn't support this property or method.
I have tried just performing a submit without the event assignment, like so:
<MAP NAME="MyMap">
<AREA SHAPE="Rect" NOHREF COORDS="82,2 163,23"
OnClick="document.forms[0].submit();">
</MAP>
This works in my non-struts form version.
Here is the html output:
<MAP NAME="MyMap">
<AREA SHAPE="Rect" NOHREF COORDS="82,2 163,23"
OnClick="document.forms[0].event.value='SELECT_COURSE';document.forms[0].sub
mit();">
</MAP>
<img src="/LAPS1/VirtualClassroomWAR/images/tab1a.gif" border="0"
usemap="#MyMap">
struts version
<strutshtml:html>
....
<strutshtml:form action="editPersonalInfo.do" name="personalInfoForm"
type="com.bmo.ifl.laps.forms.PersonalInfoForm">
....
<MAP NAME="MyMap">
<AREA SHAPE="Rect" NOHREF COORDS="82,2 163,23"
OnClick="document.forms[0].event.value='SELECT_COURSE';document.forms[0].sub
mit();">
</MAP>
<strutshtml:img usemap="#MyMap" pageKey="page.editPersonalInfo.tabImage"
border="0" />
...
</strutshtml:form>
</strutshtml:html>
non-struts version - this works
<form id=f1>
<MAP NAME="MyMap2">
<AREA SHAPE="Rect" NOHREF COORDS="82,2 163,23"
OnClick="document.forms[1].event.value='SELECT_COURSE';f1.submit();">
</MAP>
<img USEMAP="#MyMap2" SRC="<%= request.getContextPath() %>/images/tab1a.gif"
BORDER="0" >
<input type=text name=event value=UPDATE_PERSONAL_INFO>
</form>
I don't believe the image map is the problem.
I think that there is just some reason why it will not except a submit()
programmatically.
Thanks,
Michelle