Hello Guys,
I have very strange problem . the attribute of drop down box(value) is perfectly running in firefox but it gives no value in Internet explorer.
So kindly suggest me wht to do?
11 3314
Hello Guys,
I have very strange problem . the attribute of drop down box(value) is perfectly running in firefox but it gives no value in Internet explorer.
So kindly suggest me wht to do?
Try assigning values to the options.
Heya, dhaval321.
The generally-accepted way to get the value of the selected option in a SELECT element is: -
var select = {reference to the SELECT element};
-
-
var value = select.options[select.selectedIndex].value;
-
Heya, dhaval321.
The generally-accepted way to get the value of the selected option in a SELECT element is: -
var select = {reference to the SELECT element};
-
-
var value = select.options[select.selectedIndex].value;
-
Hey pbmods.
I have tried through ur code also but again same problem it is running perfectly in mozilla firefox but it is not givin any value in Internet explorer..Now i m stuck wht to do..Do u have any other way around?
Heya, dhaval321.
What does your HTML select tag look like?
Heya, dhaval321.
What does your HTML select tag look like?
-
function select()
-
{
-
alert(document.frmCalculate.selectStudentName.value);
-
}
-
<td height="46" width="229"><b><font color="#6699CC"> Select </font></b></td>
-
<td height="46" width="420">
-
<p align="left"> <select size="1" name="selectStudentName" onchange="select()">
-
<option >Select 1 </option>
-
<option >Select 2 </option>
-
<option >Select 3 </option>
-
Hi as u can see the code..when user selects particular option from drop down box select() wil be called and shows the selected value..frmCalulate is the form name .. And it shows the selected value in the mozilla firefox but in Internet explorer alert box pops up but it contains no value
Heya, dhaval321.
Thanks for posting your code.
Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Ok. Try this: -
function select()
-
{
-
var select = document.getElementsByName('selectStudentName')[0];
-
-
alert(select.options[select.selectedIndex].value);
-
}
-
-
function select()
-
{
-
alert(document.frmCalculate.selectStudentName.value);
-
}
-
<td height="46" width="229"><b><font color="#6699CC"> Select </font></b></td>
-
<td height="46" width="420">
-
<p align="left"> <select size="1" name="selectStudentName" onchange="select()">
-
<option >Select 1 </option>
-
<option >Select 2 </option>
-
<option >Select 3 </option>
-
Hi as u can see the code..when user selects particular option from drop down box select() wil be called and shows the selected value..frmCalulate is the form name .. And it shows the selected value in the mozilla firefox but in Internet explorer alert box pops up but it contains no value
yes
sure from next time i will follow that .. but ur code works same . mean workin in firefox and even in opera also but only it is not workin in Internet Explorer
Heya, dhaval321.
Interesting. I'll go ahead and get some of our PC JavaScript Experts to look at this and see what they can come up with.
Try assigning values to the options.
Follow Logician's advice. Your options don't have values. For example, you should have: [HTML]<option value="Select 1">Select 1</option>[/HTML]
PS. don't use names like select() for your functions. It can sometimes cause problems in IE and, in any case, it is bad practice.
ohh thx to all buddy,
For taking interest in this extra ordinary matter..Logisian is right have to declare value to option..Other browsers takes default but for internet explorer assigned value is must..thx to all and specially to logisian as well as pbmods and acoder..u guys helped me a lot to go further in my project
Heya, dhaval321.
Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: ouioui |
last post by:
Hi,
I try to have a communicatition between 2 windows
In the first one i have a HTML styled select like that :
<form name='addform' id='addform' action='add_dossier.php'
method='post' >...
|
by: johnsuth |
last post by:
I want to produce a trivial demonstration of dynamic modification.
I thought that pressing a button might change its color.
I studied O'Reillys books and successfully created the button with a...
|
by: jain_tj |
last post by:
Could anyone please help me with the following problem
My xml file is
==============
<fig id="F0000001">
<caption>Caption text</caption>
<image id="I0000001" image.class="halftone"...
|
by: Boki |
last post by:
Hi All,
// code start
alert("document.all.txtbox"+valueA+".value")
// end code
could you please advice,
can it show the value of txtbox ?
|
by: OtisUsenet |
last post by:
Hi,
I have a bookmarklet that works perfectly in Firefox, IE, Konqueror,
and Opera, but in Safari 2.0.3 (417.9.2) it doesn't work. I enabled
debugging and I can see "TypeError - Undefined...
|
by: riceyeh |
last post by:
Hi,
What does <xsl:if test="not($values)"mean? What I do
not understand is $values? Here, means array? And . =
$value means current node is equal to the variable value? So the total
meaning is...
|
by: Harvey Triana |
last post by:
Hi--
Sample. When i write something like:
<input type="button" name="btnSend" value="Send"
onclick="callSomeTask(getElementById('myControl').value );return false;
/>
I can run some cliente...
|
by: waltnixon |
last post by:
I've got an MS Access query which runs fine when double clicked and returns all of the rows in a test database I'm building.
I've set up a multi group report based on the query. I immediately...
|
by: ChollaPete |
last post by:
This code:
<form action="processScan.php" method="get">
<p>
<?php
print "Scan name: <input type=\"file\" name=\"tScanFileName\" value=
\"{$scanFileName}\"><br>";
addHiddenCarryons();
?>...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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: 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...
| |