raj mal

Greenhorn
+ Follow
since Feb 11, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by raj mal

thanks shankar. please look at this code.

function selectEmail(currentAccountNumber){

alert (currentAccountNumber);

for
( int i = 1; i < 6; i++)

{
if (currentAccountNumber = WorkConstants.RENewDropdowns.PACCT.getAccountId1(i) ){
//how to set email here ?

}
}
13 years ago
thanks Joe. I was trying to iterate using for loop in javascript. But I dont know how to get the values from the session constant - WorkConstants.RENewDropdowns.PACCT . Any help on this would appreciated !
13 years ago
Joe, Looks like I'm using older version - Manifest-Version: 1.0. does that mean, I can not use doubleselect ?
if so, could you please let me know how to iterate thru the the list i have (list stored in a constant).
13 years ago
Shankar, is that how iterate should code ? - ${iterate <%= WorkConstants.RENewDropdowns.PEMAIL %>}
13 years ago
Joe/Shankar,

how do you use doubleselect ? can you please provide an example, based on my requirement ? appreciate your help !
13 years ago
thanks Shankar.
I have 5 accounts and 5 emails. one to one relationship (means first account corresponds to first email). Both are seprate dropdowns. Could you please shed some more info how to do this as I'm new to javascript.
13 years ago
Thanks Shankar,
the only concern for me is there is no id/name that I can identify. I tried another jsp using regular <SELECT>. Since it is struts tag <html:select> which doesnt have a name/id to give. See my sample code for <SELECT> which works fine. how do you use the same if i have <html:select> tag with label and value (see my code in my first posting)

<HTML>
<HEAD>
<script language="javascript" type="text/javascript" >
<!-- hide

function selectPartner(x){
if (document.form1.Person.value != "null") {
alert(x);
document.form1.Native.options[x].selected =true

}
}

// end hide -->
</script>
</HEAD>
<body>
<form name="form1">
<select name="Person" onChange="selectPartner(document.form1.Person.options[document.form1.Person.options.selectedIndex].value)">
<option>Choose..</option>
<option value=1>Vegitable</option>
<option value=2>Fruits</option>
</select>

<select name="Native">
<option>Native is..</option>
<option value=0>Okra</option>
<option value=1>Apple</option>
</select>

</form>
</body>
</HTML>

13 years ago
I have the below dropdowns. I need to select the second dropdown (email) when the user select an entry in first dropdown (accounts). if accountid2 is selected, email-id2 must be selected. if other, other should be selected. how to do that using onchange fuction. please note that it uses struts tag - <html:select>

<td>1. Member Account Number<span class="bodyCopy"><font color="#ff0000"> * </font></span>:
<html:select name="DataForm" property="accountNumber" styleClass="formContent"
style="width:80px" >

<option>${reDataForm.accountNumber}</option>

<html:options collection="<%= WorkConstants.RENewDropdowns.PACCT %>" property="value" labelProperty="label" styleClass="formContent"/>
</html:select>

<td>3. Member <br>E-mail Address:<br /> <span class="bodyCopy" ></span>
<html:select name="DataForm" property="emailAddress" style = "width:150px" styleClass="formContent">
<option>${reDataForm.emailAddress}</option>
<html:options collection="<%= WorkConstants.RENewDropdowns.PEMAIL %>" property="value" labelProperty="label" styleClass="formContent"/>
</html:select>
13 years ago
JSP
I have the below dropdowns. I need to select the second dropdown (email) when the user select an entry in first dropdown (accounts). if accountid2 is selected, email-id2 must be selected. if other, other should be selected. how to do that using onchange fuction. please note that it uses struts tag - <html:select>

<td>1. Member Account Number<span class="bodyCopy"><font color="#ff0000"> * </font></span>:
<html:select name="DataForm" property="accountNumber" styleClass="formContent"
style="width:80px" >

<option>${reDataForm.accountNumber}</option>

<html:options collection="<%= WorkConstants.RENewDropdowns.PACCT %>" property="value" labelProperty="label" styleClass="formContent"/>
</html:select>

<td>3. Member <br>E-mail Address:<br /> <span class="bodyCopy" ></span>
<html:select name="DataForm" property="emailAddress" style = "width:150px" styleClass="formContent">
<option>${reDataForm.emailAddress}</option>
<html:options collection="<%= WorkConstants.RENewDropdowns.PEMAIL %>" property="value" labelProperty="label" styleClass="formContent"/>
</html:select>
13 years ago
have a dropdown where i have set of account numbers and an option of "Other". user can select any account or they can user "Other" option to enter a new account. I have the code like this:
<td>1. Member Account Number<span class="bodyCopy"> * </span>: <html:select name="DataForm" property="accountNumber" styleClass="formContent" style="width:80px" onchange="toggleField(this.value);"> <html:options collection="<%= WorkConstants.TEST1 %>" property="value" labelProperty="label" styleClass="formContent"/> <option value="Other">Other </option> </html:select> <input type="text" id="Other" value="accountNumber" name="accountNumber" style="display:none;" maxlength="9" size="9" > </td>

Togglefield function is as below

<script type="text/javascript"> function toggleField(value) {var a = document.getElementById('Other'); (value == 'Other')? a.style.display = 'block' : a.style.display = 'none';}

My question is, 1) when I select other, the text box displays- good. But how to assign the value to accountNumber ? when I click submit, it is not recognizing getting invalid account number. 2) When the page refreshes with validation errors, how do I retain value "other" and the text box with the number that is entered? appreciate your input on this.
13 years ago