Weird javascript problem
I need to change the action of a form dynamically. It should happen on selection of a drop down list.
I have this select code
<bean:define id="a" name="approvalForm"></bean:define>
<html:select property="approvalConfiguration.claimType.id"
onchange="get(this.form);" name="a">
<html:option value="0">-Select-</html:option>
<bean:define id="b" property="claimType" name="approvalForm"></bean:define>
<logic:present property="claimType" name="approvalForm" >
<html:options collection="claimType" labelProperty="name"property="id" />
</logic:present>
</html:select>
My form is defined like
--
<html:form action="/approve">
js
function get(obj){
alert(obj.action);
}
It always alerts [object]
I tried
document.approvalForm.action
document.forms.approvalForm.action.
and the main problem is... It wont let me change the "action" , since it is returning an Object.
alert(obj.name ) - prints the correct name, ie approvalForm
The browser is IE 7 and I use websphere v 6.1
What is that am doing wrong here? Any suggestions will be of great help.
Thank You
RG

