<HTML:SELECT onChange="onSelection();"> HELP!!!!!!

A

Anders S. Clausen

Hi

I have a selection box on a pop-up window and I would like to get the
value every time a new value is selected in the selection box. How do
I pass that value in to the onSelection() that I'm calling from the
onChange event handler??? See code below.

<html:select name="dealDocumentUploadForm" property="documentType"
size="1" styleclass="dropdown" styleId="documentType"
onChange="onSelection();">
<bean:define id="documentTypeList"
name="<%=UIConstants.DEAL_BEAN_KEY%>" property="documentTypeList"
type="java.util.Collection"/>
<html:eek:ptions collection="documentTypeList" property="value"
labelProperty="label" />
</html:select>

Cheers.

Anders
 
C

Chris Riesbeck

Hi

I have a selection box on a pop-up window and I would like to get the
value every time a new value is selected in the selection box. How do
I pass that value in to the onSelection() that I'm calling from the
onChange event handler??? See code below.

<html:select name="dealDocumentUploadForm" property="documentType"
size="1" styleclass="dropdown" styleId="documentType"
onChange="onSelection();">

onSelection(this.options[this.selectedIndex].value)
 
Joined
Jan 5, 2009
Messages
1
Reaction score
0
How to call Struts Action using JavaScript

My web page has a drop down box, and I want to call struts action as
soon as the value changes from the drop down.
(Basically submit a form using JavaScript on "onchange" event of
dropdown)

my script is given below:
<script language="Javascript">

function selectServiceType() {
var len = document.forms.length;
var formName = null;
for(var i = 0; i < len; i++) {
formName = document.forms;
}
document.form.submit();
}

my select tag is like this:

<html:select property="selectedServiceTypeProp" onchange="selectServiceType()">

Can someone give me a direction for such JavaScript?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top