Hi all,
combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editabl e 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
May 11 '07
33 5567
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
acoder 16,027
Recognized Expert Moderator MVP
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
acoder 16,027
Recognized Expert Moderator MVP
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;
-
}
-
}
acoder 16,027
Recognized Expert Moderator MVP
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.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 u
acoder 16,027
Recognized Expert Moderator MVP
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?
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 between the two menus
gets bigger. What is the cause of this? Thanks
CODE:
|
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 like to eventually be able to filter
down through the
tables untill i can reach one unique record. I am creating a datbase
to keep track of registered accounts for a stae program. Each
account is registered into the program through a two...
|
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
I've got a subform with a series of cascading combo boxes (thanks to
the Access tutorials on fontstuff.com) that let the user assign
categories to items, in this case photos. This is being done to help
constrain user selections and keep the...
|
by: neousr |
last post by:
var row = document.createElement('TR');
row.setAttribute('class',tipoclase);
.....
var cell = document.createElement('TD');
var theButton = document.createElement('input');
theButton.setAttribute('type','button');
theButton.setAttribute('value',description);
theButton.setAttribute('class',ButtonClass);
cell.appendChild(theButton);
row.appendChild(cell);
|
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 populate the combo (for a list of
2500).
Can anybody optimize the code. I tried Duffs devise instead of 'for
loop', but no improvement.
| |
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 for the
secretaries working in the office. I would like them to be able to
easily search through all the records using a combo box, that they can
just type in the person's name. I have managed to make it work so far
as when the last name is...
|
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 follows:
function changeMe(str) {
if(str.value == "se") {
while(document.frm.combo2.length 0) {
|
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.
If the user selects any of the item, that item so selected should not
appear in the list again; or
The user should be warned about previous selection.
|
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 a database based on the machines used for the maintenance of a golf course here in South Africa.
I have tables containing the "Groups of Machines", "Machines" and the "Types of Fuel" they use with Prices per Lt.
I have created a form thats been...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |