Post your code. Remember you have to use null for the second argument as I posted earlier.
Combo box code is Working in IE perfectly but it is not working in FireFox
Collapse
X
-
Originally posted by acoderPost your code. Remember you have to use null for the second argument as I posted earlier.
here i am posting my code this also working in IE but not in FF my code follows
[CODE=javascript]function displayComboVal ues(comboName,c omboValue){
if(document.for mmain(comboName ).type=='select-one'){
var optn = document.create Element("OPTION ");
optn.text = comboValue;
optn.value = comboValue;
try{
document.formma in(comboName).o ptions.add(optn ,null);
}
catch(ex){
document.formma in(comboName).o ptions.add(optn );
}
document.formma in(comboName).o ptions[document.formma in(comboName).l ength-1].selected=true;
}else{
document.formma in(comboName).v alue=comboValue ;
}
}[/CODE]Comment
-
Instead of [CODE=javascript]if(document.for mmain(comboName ).type=='select-one'){[/CODE] try: [CODE=javascript]if(document.for mmain[comboName].name=='select-one'){[/CODE] Surely, you mean the name, not the type.
Perhaps you could post your form HTML as well as how you are calling this function.Comment
-
Originally posted by acoderInstead of [CODE=javascript]if(document.for mmain(comboName ).type=='select-one'){[/CODE] try: [CODE=javascript]if(document.for mmain[comboName].name=='select-one'){[/CODE] Surely, you mean the name, not the type.
Perhaps you could post your form HTML as well as how you are calling this function.
hi ,
even i change it if(document.for mmain(comboName ).name=='select-one'){ no use same thing happening . here i am sending code how i am declaering and calling combobox
[HTML]<td width="40%" align="center" valign="center" >
<select name="medDirect ion<%=i%>" style="font-family:Verdana; font-size: 8pt; color: #000000;border: 0px solid #666666 ; BORDER-WIDTH: 1px; BORDER-STYLE: inset; width:500px" class="subvalue " onKeyDown="fnKe yDownHandler(th is, event);" onKeyUp="fnKeyU pHandler_A(this , event); return false;" onKeyPress = "return fnKeyPressHandl er_A(this, event);" onChange="fnCha ngeHandler_A(th is, event);"
value="<jsp:get Property name="_adminBea n" property="medDi rection"/>">
<option value=""></option>
<option value="AC">AC</option>
<option value="BID">BID </option>
<option value="GT">GT</option>
<option value="HS">HS</option>
<option value="OD">OD</option>
</select>
</td>[/HTML]
for displaying these combo box values calling the method like this
<Script>
displayComboVal ues("medDirecti on0",'<%=_admin Bean.getMedDire ction()%>');
</Script>
pls tell me where is the problem
Thanking uComment
-
Originally posted by acoderWhat's "select-one"? The type of a combo box is going to be "select".
Do you get any errors? If so, on what line?
select-one is the combobox name . we didnt get any errors . combobox working fine but the values are not displaying in the FireFox .
Thanking uComment
-
Ok, i know this comes a little late on the topic, but i had to comment on this.
build a select box (size=1 line)
give it some dummy options
now, add the following
onchange="alert (this.type)"
any guess what it will return? i will give you a hint, it's not "select"
it will return "select-one" and if it's a multiple select it will return... yes, you guessed it "select-multiple"
so checking on the o.type=="select-one" is perfectly valid;
just thought i would weigh in on that.
Originally posted by acoderInstead of [CODE=javascript]if(document.for mmain(comboName ).type=='select-one'){[/CODE] try: [CODE=javascript]if(document.for mmain[comboName].name=='select-one'){[/CODE] Surely, you mean the name, not the type.
Perhaps you could post your form HTML as well as how you are calling this function.Comment
-
bus, did you ever solve this?
i wonder if the problem isn't the fact that you are addressing the element with the wrong indexing operator... actually i am surprised it's working in any broswer
rather then
Code:document.formname[B]([/B]formelement[B])[/B].type==
Code:document.formname[B][[/B]formElement[B]][/B].type==
Originally posted by buss123select-one is the combobox name . we didnt get any errors . combobox working fine but the values are not displaying in the FireFox .
Thanking uComment
-
Originally posted by voxechoOk, i know this comes a little late on the topic, but i had to comment on this.
build a select box (size=1 line)
give it some dummy options
now, add the following
onchange="alert (this.type)"
any guess what it will return? i will give you a hint, it's not "select"
it will return "select-one" and if it's a multiple select it will return... yes, you guessed it "select-multiple"
so checking on the o.type=="select-one" is perfectly valid;
just thought i would weigh in on that.
kind regards ...Comment
-
Originally posted by voxechoOk, i know this comes a little late on the topic, but i had to comment on this.
build a select box (size=1 line)
give it some dummy options
now, add the following
onchange="alert (this.type)"
any guess what it will return? i will give you a hint, it's not "select"
it will return "select-one" and if it's a multiple select it will return... yes, you guessed it "select-multiple"
so checking on the o.type=="select-one" is perfectly valid;
just thought i would weigh in on that.
Incidentally, I found this - silly me for not checking.Comment
-
compatible word for 'select-one' in Firefox
Hi all,
the following line of code is working fine in IE but the same line of code is not working in Firefox . can any one help me is there any other way to write the same line of code for firefox.
if(document.for mmain(comboName ).type=='select-one')
my main doubt is 'select-one' will work in firefox or not? if not pls tell me is there any alternative for that.Comment
-
-
Originally posted by acoderThis reminds me of your earlier thread. Is it the same problem?
Yes after a long time again i shifteed to that problem again , what is the compatiable word to "select-one"Comment
-
Originally posted by buss123Yes after a long time again i shifteed to that problem again , what is the compatiable word to "select-one"
The syntaxCode:document.formmain(comboName)
Code:if(document.formmain[B][[/B]comboName[B]][/B].type=='select-one')
Comment
Comment