Hi all,
combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r not dislaying if enter the data the it is inserting properly) javascript code follows
pls help me to solve this problem Please post code using code tags - moderator
pls help me i am not able to do this
33 5468
hi all,
this is sivakumar, i am using javascript function for displaying the values but it is working well in IE fine but that function was not working in Firefox Please help me to solve the above situvation . code follows as below
function displayComboValues(comboName,comboValue){
if(document.formmain(comboName).type=='select-one'){
var optn = document.createElement("OPTION");
optn.text = comboValue;
optn.value = comboValue;
document.formmain(comboName).options.add(optn);
document.formmain(comboName).options[document.formmain(comboName).length-1].selected=true;
}else{
document.formmain(comboName).value=comboValue;
}
}
pls help me to overcome this situvation
I need to see the form also
Hi all,
i am using javascript function for displaying the values in the edit mode. it was working fine in the IE but not working in the Firefox pls help me to display the values in the both IE and Firefox .
my code follws - function displayComboValues(comboName,comboValue){
-
if(document.formmain(comboName).type=='select-one'){
-
var optn = document.createElement("OPTION");
-
optn.text = comboValue;
-
optn.value = comboValue;
-
document.formmain(comboName).options.add(optn);
-
document.formmain(comboName).options[document.formmain(comboName).length-1].selected=true;
-
}else{
-
document.formmain(comboName).value=comboValue;
-
}
-
}
pls help me to overcome this situvation
I need to see the form also
<script language=javascript src='../jsp/DropDowns.js'></script>
<td width="65%" align="center" valign="center" >
<select name="medDirection0" style="font-family:Verdana; font-size: 8pt; color: #000000;border: 0px solid #666666 ; BORDER-WIDTH: 1px; BORDER-STYLE: inset; width:500px" class="subvalue" onKeyDown="fnKeyDownHandler(this, event);" onKeyUp="fnKeyUpHandler_A(this, event); return false;" onKeyPress = "return fnKeyPressHandler_A(this, event);" onChange="fnChangeHandler_A(this, event);" onChange="fnChangeHandler_A(this, event);" value="<jsp:getProperty name="_adminBean" property="medDirection"/>">
<option value=""></option>
<option value="AC">AC</option>
<option value="BID">BID</option>
<option value="GT">GT</option>
<option value="HS">HS</option>
</select>
<Script>
displayComboValues("medDirection0",'<%=_adminBean. getMedDirection()%>');
</Script>
</td>
hi above three satements r using for displaying the combo box values displayComboValues("medDirection0",'<%=_adminBean. getMedDirection()%>');
</Script>
this method was working in the IE but it is not working in the Firefox . in Firefox the selected combobox values r displaying empty. displayComboValues()method code yesterday i posted already .
pls help me to overcome this situvation
Regards
SivaKumar
<script language=javascript src='../jsp/DropDowns.js'></script>
<td width="65%" align="center" valign="center" >
<select name="medDirection0" style="font-family:Verdana; font-size: 8pt; color: #000000;border: 0px solid #666666 ; BORDER-WIDTH: 1px; BORDER-STYLE: inset; width:500px" class="subvalue" onKeyDown="fnKeyDownHandler(this, event);" onKeyUp="fnKeyUpHandler_A(this, event); return false;" onKeyPress = "return fnKeyPressHandler_A(this, event);" onChange="fnChangeHandler_A(this, event);" onChange="fnChangeHandler_A(this, event);" value="<jsp:getProperty name="_adminBean" property="medDirection"/>">
<option value=""></option>
<option value="AC">AC</option>
<option value="BID">BID</option>
<option value="GT">GT</option>
<option value="HS">HS</option>
</select>
<Script>
displayComboValues("medDirection0",'<%=_adminBean. getMedDirection()%>');
</Script>
</td>
hi above three satements r using for displaying the combo box values displayComboValues("medDirection0",'<%=_adminBean. getMedDirection()%>');
</Script>
this method was working in the IE but it is not working in the Firefox . in Firefox the selected combobox values r displaying empty. displayComboValues()method code yesterday i posted already .
pls help me to overcome this situvation
Regards
SivaKumar
Sir form meens total form section in the jsp page?
Where do you get the error? What errors do you see?
I'm assuming you see the error on the "add" method.
See this thread.
Also, see the source on this link (see comments - add with one argument is IE-only, not standard-compliant)
Just noticed the duplicate thread. I've merged the threads. Please do not double-post.
Hi all ,
i am new to javascript the following function is working IE well but it is not working in FireFox pls help me to solve this problem it is very urgent for me. Pls help me
my code follows - function displayComboValues(comboName,comboValue){
-
if(document.formmain(comboName).type=='select-one'){
-
var optn = document.createElement("OPTION");
-
optn.text = comboValue;
-
optn.value = comboValue;
-
document.formmain(comboName).options.add(optn);
-
document.formmain(comboName).options[document.formmain(comboName).length-1].selected=true;
-
}else{
-
document.formmain(comboName).value=comboValue;
-
}
-
}
The add method should have two arguments.
The standards compliant way would be:
Unfortunately, this doesn't work in IE, so you would have to use the following code: - try {
-
document...options.add(optn, null); // standards compliant
-
} catch(ex) {
-
...options.add(optn); // IE
-
}
Hi all, i am using javascript code getting combo box. But in IE it is displaying with selected values but in FireFox insted of selected values it is displaying empty combo box. for displaying combo box values i am using following code pls tell me where is the mistake in the code - function displayComboValues(comboName,comboValue){
-
if(document.formmain(comboName).type=='select-one'){
-
var optn = document.createElement("OPTION");
-
optn.text = comboValue;
-
optn.value = comboValue;
-
document.formmain(comboName).options.add(optn);
-
document.formmain(comboName).options[document.formmain(comboName).length-1].selected=true;
-
}else{
-
document.formmain(comboName).value=comboValue;
-
}
-
}
thanking u
Try to use ....Option. -
var combo_box = document.formname.obj_name;
-
combo_box.options.length = 0; //Empty.
-
combo_box.options[0] = new Option(value_0,text_0);
-
//-------
-
combo_box.options[n-1] = new Option(value_n_1,text_n_1);
-
now see the effect.
kind regards.
dmjpro.
Hi all i am using javascript function for displaying the combobox values but it is working in IE Fine, but in FireFox it is not displaying any values i am getting only blank combo box only.please help me too overcome the situvation my code follows as - function displayComboValues(comboName,comboValue){
-
if(document.formmain(comboName).type=='select-one'){
-
var optn = document.createElement("OPTION");
-
optn.text = comboValue;
-
optn.value = comboValue;
-
document.formmain(comboName).options.add(optn);
-
document.formmain(comboName).options[document.formmain(comboName).length-1].selected=true;
-
}else{
-
document.formmain(comboName).value=comboValue;
-
}
-
}
thanking u
All three threads merged.
See my reply. The add method must have two arguments for Firefox and standards-compliant browsers.
All three threads merged.
See my reply. The add method must have two arguments for Firefox and
standards-compliant browsers.
thanks for reply . , even though i use 2 parameter it is not working in firefox pls help me
Thanking u
Post your code. Remember you have to use null for the second argument as I posted earlier.
Post 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 - function displayComboValues(comboName,comboValue){
-
if(document.formmain(comboName).type=='select-one'){
-
var optn = document.createElement("OPTION");
-
optn.text = comboValue;
-
optn.value = comboValue;
-
try{
-
document.formmain(comboName).options.add(optn,null);
-
}
-
catch(ex){
-
document.formmain(comboName).options.add(optn);
-
}
-
document.formmain(comboName).options[document.formmain(comboName).length-1].selected=true;
-
}else{
-
document.formmain(comboName).value=comboValue;
-
}
-
}
Instead of - if(document.formmain(comboName).type=='select-one'){
try: - if(document.formmain[comboName].name=='select-one'){
Surely, you mean the name, not the type.
Perhaps you could post your form HTML as well as how you are calling this function.
Instead of - if(document.formmain(comboName).type=='select-one'){
try: - if(document.formmain[comboName].name=='select-one'){
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.formmain(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="medDirection<%=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="fnKeyDownHandler(this, event);" onKeyUp="fnKeyUpHandler_A(this, event); return false;" onKeyPress = "return fnKeyPressHandler_A(this, event);" onChange="fnChangeHandler_A(this, event);"
value="<jsp:getProperty name="_adminBean" property="medDirection"/>">
<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>
displayComboValues("medDirection0",'<%=_adminBean. getMedDirection()%>');
</Script>
pls tell me where is the problem
Thanking u
What's "select-one"? The type of a combo box is going to be "select".
Do you get any errors? If so, on what line?
What'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 u
The name of the combo box that you're passing is "MedDirection0"
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.
Instead of - if(document.formmain(comboName).type=='select-one'){
try: - if(document.formmain[comboName].name=='select-one'){
Surely, you mean the name, not the type.
Perhaps you could post your form HTML as well as how you are calling this function.
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 - document.formname(formelement).type==
try - document.formname[formElement].type==
note the [ rather then (
select-one is the combobox name . we didnt get any errors . combobox working fine but the values are not displaying in the FireFox .
Thanking u
gits 5,390
Expert Mod 4TB
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.
;) interesting hint i tested it and of course you're right ... i didn't know about that (and never needed it yet but good to know now) ... thank you for this ...
kind regards ...
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.
Interesting - I didn't know that. Thanks for pointing that out.
Incidentally, I found this - silly me for not checking.
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.formmain(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.
This 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"
Yes after a long time again i shifteed to that problem again , what is the compatiable word to "select-one"
You still don't seem to understand, the problem has nothing to do with the type identifier.
The syntax - document.formmain(comboName)
is incorrect as it constitutes a function call not a reference. The Firefox error console must be indicating this. - if(document.formmain[comboName].type=='select-one')
hi
type= ='select-one' can work in firefox and IE,because this property is defined in DOM Level1,but you should get the 'select' by using DOM. for example:
[HTML]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<select id="listmul" name="listmul" multiple></select>
<br />
<script language="javascript">
<!--
document.write ( document.getElementById("listmul").type);
-->
</script>
<br />
<select id="listsgl" name="listsgl"></select>
<br />
<script language="javascript">
<!--
document.write ( document.getElementById("listsgl").type);
-->
</script>
</body>
</html>
[/HTML]
the output is
select-multiple
select-one
hope it helps.
Yes after a long time again i shifteed to that problem again , what is the compatiable word to "select-one"
Merged the threads then.
You still don't seem to understand, the problem has nothing to do with the type identifier.
The syntax - document.formmain(comboName)
is incorrect as it constitutes a function call not a reference. The Firefox error console must be indicating this. - if(document.formmain[comboName].type=='select-one')
Thank U very much for ur reply now it working fine in both IE and FF
Thank U very much for ur reply now it working fine in both IE and FF
Well, after almost 5 months, aren't you glad?
It shouldn't have worked in any browser in the first place.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: christian9997 |
last post by:
Hi
I would be very helpful if someone could help me with this code.
It works fine in IE but when I display it in Netscape or Firefox and I
move the mouse from one menu to the other the gap...
|
by: Sean |
last post by:
Greetings all,
I am attempting to make a form that will filter through several tables
that
(I believe) have refretial integrity. I am pulling data from several
tables into the form and i would...
|
by: cognoscento |
last post by:
I'm currently putting together a database for my work (not an expert by
any stretch, so muddling through as best as I can... you know the
story...) and I could use some advice and hand-holding
...
|
by: neousr |
last post by:
var row = document.createElement('TR');
row.setAttribute('class',tipoclase);
.....
var cell = document.createElement('TD');
var theButton = document.createElement('input');...
|
by: kiranmn75 |
last post by:
I want to dynamically populate a combo box through javascript. Data is
coming from a array. Sometimes data list may contain items in excess of
2000.
Explorer takes more than 5 seconds to...
|
by: mf193 |
last post by:
Hi,
I have a table of around 1000 rows; patient records. Each row is
individually defined by a Patient ID number which is my primary key.
I have made a simple form to display patient information...
|
by: atulvp |
last post by:
Hi all,
I have written a javascript code which changes the combo_2 options on
runtime. It is working fine on IE but not working on Firefox. Please
help me solve this problem.
My code is as...
|
by: henry.onovwaka |
last post by:
Can someone help on this problem.
I have a combo box of, say three Items, selected from a table that
serves as the lookup: E.g. 1 Earth, 2 Pine, 3 Earth Grave
The combo box is on the subform.
...
|
by: Kitty001 |
last post by:
Hi Guys
I am new to MS Access and using MS Access2007.
I have been fooling around with Access trying to solve this problem for weeks but i just cant seem to chack it and I need some help.
I have...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |