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

[1723 byte] By [R@njita] at [2007-11-27 6:19:35]
# 1
Your JavaScript looks fine. The only time alerting form.action should alert [object] is if there is a form element with the name "action", so you'd be referencing that element instead of the action property of the form.Can you post the HTML that is being written to the page?
ducksaucea at 2007-7-12 17:34:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi ducksauce, That exactly was the problem. after posting the issue I sorted that out. I had a <html:reset> which had the property="action" which i found later on..You guessed correctly , Thank You
R@njita at 2007-7-12 17:34:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...