473,503 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stack overflow in IE but nothing in Firefox

First of all, sorry for my English!!!
I want to display or not a text field (named other_category) depending
on the value of text field named exercise_category. If last's value is
"other" then the "other_category" field should be displayed. The
following script is placed in the page.
<script language="javascript">
function onchange(){
var x=document.getElementById("exercise_category");
var y=document.getElementById("other_category");

var value=x.options[x.selectedIndex].value;

if (value=="other"){

y.style.display="";
}
else {
y.style.display="none";
}
}
</script>

The "exercise_category" field is generated dynamically from a
database.The following code is where the field is generated and the
call on Javascript is happening.

<div align="center">
<table width="80%" border="1">
<tr>
<th scope="row"><div align="left">Êáôçãïñßá
Üóêçóçò </div></th>
<th scope="row"><select name="exercise_category"
id="exercise_category" onChange="onchange();"><?php
require_once('bookmark_fns.php');
session_start();
$db_conn = db_connect();
$query = "select distinct exercise_category from exercise";
$result = mysql_query($query, $db_conn);
while ($row=mysql_fetch_array($result)){
$exercise_category=stripslashes($row['exercise_category']);
$display_block.="<option value=\"$exercise_category\">
$exercise_category</option>";
}
$display_block.="<option value=\"other\"¶ëëç</option>";
echo $display_block;
?>
</select></th>
</tr>
<tr>
<th scope="row"><div align="left">ÍÝá
êáôçãïñßá Üóêçóçò </div></th>
<th scope="row"><input name="other_category"
type="text" id="other_category" maxlength="30" style="display: none">
</th>
</tr>

There is no problem in Firefox, when i choose other the
"other_category" text field is displayed. But in IE stack overflow is
happening when there is a call on Javascript.

Please help!!!!!!!!!!!!!!!!!!!!!!
Hello from beautiful Greece!!!!!!!!!!!!!

Dec 29 '06 #1
2 1461
giankara wrote:
function onchange(){
<th scope="row"><select name="exercise_category"
id="exercise_category" onChange="onchange();">
Change the name of the function to something other than 'onchange' e.g.
simply use
function categoryChangeHandler () { ... }
<select onchange="categoryChangeHander();">

Or explictly call
<select onchange="window.onchange();">

Note, independent of your problem, you can simply pass the this object
to the handler e.g.

<select onchange="categoryChangeHander(this);" ...>
function categoryChangeHandler (select) {
if (select.value == "other")
--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 29 '06 #2
thank you very much!!!!
It is working now.

Ï/Ç Martin Honnen Ýãñáøå:
giankara wrote:
function onchange(){
<th scope="row"><select name="exercise_category"
id="exercise_category" onChange="onchange();">

Change the name of the function to something other than 'onchange' e.g.
simply use
function categoryChangeHandler () { ... }
<select onchange="categoryChangeHander();">

Or explictly call
<select onchange="window.onchange();">

Note, independent of your problem, you can simply pass the this object
to the handler e.g.

<select onchange="categoryChangeHander(this);" ...>
function categoryChangeHandler (select) {
if (select.value == "other")
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7055
by: Aguilar, James | last post by:
Hello all, To begin, yes, this -is- a homework assignment. However, it is for my Algorithms class, and my instructor has given us explicit permission to use "expert" groups like newsgroups, so...
13
2055
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does...
19
3110
by: Jim | last post by:
I have spent the past few weeks designing a database for my company. The problem is I have started running into what I believe are stack overflow problems. There are two tab controls on the form...
4
9035
by: Victor | last post by:
Hello, I've got a situation in which the number of (valid) recursive calls I make will cause stack overflow. I can use getrlimit (and setrlimit) to test (and set) my current stack size. ...
8
2018
by: Geoff Cox | last post by:
Hello, When using Internet Explorer, on networked PCs in a college, to view a page of mine with Javascript code in it the "stack overflow" error message appears. When I access the same file...
7
22016
by: amit.atray | last post by:
Environement : Sun OS + gnu tools + sun studio (dbx etc) having some Old C-Code (ansi + KR Style) and code inspection shows some big size variable (auto) allocated (on stack) say for ex. char...
12
11811
by: Geoff Cox | last post by:
Hello, Some one is getting the "stack overflow" error message when using a Javascript program which I wrote when using Internet Explorer but not when using Mozilla. Any ideas as to how I...
4
1715
by: asit | last post by:
we kno during call of a subroutine, the address of next instruction( from which the execution is supposed to start after the subroutine is executed ) is stored in stack. in case of recursion (e.g....
4
6330
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
Visual Studio 2005, C# WinForms application: Here’s the question: How can I increase the standard 1 MB stack size of the UI thread in a C# WinForms application? Here’s why I ask: I’ve...
0
7205
marktang
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,...
0
7093
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...
0
7353
jinu1996
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...
1
7011
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...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4689
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...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.