Hi,

I call a javascript function when a option is selected in a drop down list. 
onchange=showTextField(actionselected,index). and display a textfield for some 
options.
<logic:iterate name="autoForm" property="menuEntries"id="menuEntries" 
indexId="idx">
<html:select name="menuEntries" property="menuAction"
onchange='<%="showOrHidePhoneNumber(this.value, "+idx+");"%>'>

I have to call same function when the page loads and display a text field for 
some options which were selected earlier for the same user.

so,how do i call pass the arguments onloading since I have the html select in a 
loop , I mean I have 11 dropdownlists and have to pass the option selected and 
index for each drop down list.

Thanks.
 







Erik Weber <[EMAIL PROTECTED]> wrote: I'm not sure if I understand completely, 
but could how about a 
JavaScript body "onload" call?

Erik


Srilatha Salla wrote:

>Hi,
> 
>In my application I have menu.jsp which has a ligic tag,
> 
>
> 
> 
> 
> 
> 
> 
> '>
> Select A Action
> 
> 
> 
> 
> " style="DISPLAY: none">
> 
> 
> 

> 
> 
> 
> 
> so I have the javascript function ---------
>
> function showOrHidePhoneNumber(actionselected,index) {
> alert(index);
> alert(actionselected);
> if(actionselected=="Transfer with prompt") {
> document.getElementById(index).style.display = "inline";
> } else if(actionselected=="Transfer without prompt"){
> document.getElementById(index).style.display = "inline";
> }else if(actionselected=="Transfer to operator"){
> document.getElementById(index).style.display = "inline";
> }else {
> document.getElementById(index).style.display = "none";
> }
> }
> which displays the textfield for phoneNumber only when the option selected is 
> "Transfer with prompt/Transfer without prompt/Reach operator", otherwise the 
> textfield for phone number is not displayed.
> 
> This is working fine when i add a menuentry.
> But when I have to come to this page to edit 
> I have to call the -------- showOrHidePhoneNumber(actionselected,index) 
> function 
> when the page loads and display phonenumber only if the options are as I 
> mentioned above. Please help me figure how out how to do this.
> 
>Thanks,
>Latha.
> 
>
> 
>---------------------------------
>Do you Yahoo!?
> Check out the new Yahoo! Front Page. www.yahoo.com
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




                        
---------------------------------
Do you Yahoo!?
 Check out the new Yahoo! Front Page. www.yahoo.com

Reply via email to