Hi,
I have the following script - function submitForm1()
-
{
-
document.forms[0].action="SearchRecords";
-
document.forms[0].submit();
-
}
[HTML]<select name="l" onchange="submi tForm1();">[/HTML]
This script is working on firefox but not in IE6.
Can anybody tell me why this is happening and the alternative solution to perform the same function.
Thanks
Oct 29 '07
26 3380 acoder 16,027
Recognized Expert Moderator MVP
As I told you before, you have to change the name of the submit button. IE is very easily confused!
On line 89, you have:[HTML]<input type=submit name=action value="Submit" onclick="submit Form2();">[/HTML] Change "action" to "action1" or some other name that is not the name of a method or attribute.
As I told you before, you have to change the name of the submit button. IE is very easily confused!
On line 89, you have:[HTML]<input type=submit name=action value="Submit" onclick="submit Form2();">[/HTML] Change "action" to "action1" or some other name that is not the name of a method or attribute.
Hi,
I have tried it but still its not working
Thanks
acoder 16,027
Recognized Expert Moderator MVP
Hi,
I have tried it but still its not working
Thanks
So what happens now? Any errors? Can you also post your revised code?
So what happens now? Any errors? Can you also post your revised code?
Hi,
Revised code as below - <%@ page import="java.util.ArrayList"%>
-
<%@ page import="javax.servlet.*"%>
-
<%@ page import="javax.servlet.http.*"%>
-
-
<html>
-
<head>
-
<title> Form </title>
-
<script language="javascript" type="text/javascript">
-
-
function submitForm1()
-
{
-
-
document.forms[0].action="SearchRecords";
-
alert("fghfhfhf");
-
-
document.forms[0].submit();
-
}
-
function submitForm2()
-
{
-
document.forms[0].action="Search";
-
document.forms[0].submit();
-
}
-
</script>
-
-
<%
-
ArrayList al=(ArrayList)session.getAttribute("str_");
-
%>
-
-
-
</head>
-
-
-
-
<body bgcolor="fuschia">
-
-
-
-
<center>
-
-
<font size=7 color="red"> Please Enter the following information: </font>
-
<form name="form1" method="POST">
-
-
<table cellspacing="2" cellpadding="2" border="0">
-
<tr>
-
<td><input type="hidden" name="role" id="role"></td>
-
</tr>
-
-
<tr>
-
<td align="left"><font size=5>Last Name</font></td>
-
<td> <input type=text name="sn" value="<%=request.getAttribute("lname") %>"></td>
-
</tr>
-
-
<tr>
-
<td align="left"><font size=5>FullName</font></td>
-
<td> <input type=text name="cn" value="<%=request.getAttribute("fname")%>"><td>
-
</tr>
-
-
<tr>
-
<td align="left"><font size=5>Location</font></td>
-
<td>
-
<select name="l" onchange="submitForm1();">
-
<%if(request.getAttribute("location")!=null)%>
-
<Option value="<%=request.getAttribute("location")%>><%=request.getAttribute("location")%></Option>
-
<Option value="Chandigarh">Chandigarh</Option>
-
<Option value="Pune">Pune</Option>
-
<Option value="Banglore">Banglore</Option>
-
</select> </td>
-
</tr>
-
-
<tr>
-
<td align="left"><font size=5>Role</font></td>
-
<%try{%>
-
<TD>
-
<select name="erRoles" id="erRoles">
-
<option>- - - - - - -</option>
-
<%for(int i=0;i<al.size();i++){%>
-
<Option value="<%=al.get(i).toString()%>"><%=al.get(i).toString()%></Option>
-
<%}%>
-
</select>
-
</TD>
-
<%}
-
catch(Exception e)
-
{
-
e.printStackTrace();
-
}%>
-
</tr>
-
-
<tr>
-
<td align="right"><input type=submit name=action value="Submit" onclick="submitForm2();"></td>
-
<td align="left"> <input type=reset name="submitButton" value="Reset"></td>
-
</tr>
-
</table>
-
-
</form>
-
</center>
-
</body>
-
</html>
The same situation ie when i use alert box before setting document.forms[0].action="Search Records" it shows the alert bax on onchange event but don't submit the code but when i place alert before document.forms[0].action="Search Records" neither it shows alert box nor it submits the form.
Even in both the cases it shows a warning (that browser shows when page loads) and the details are Line: 12
Char: 4
Error: Object doesn't support this property or Method
Code: 0
URL: ............... ............
Thanks
acoder 16,027
Recognized Expert Moderator MVP
You've not actually made the change.
Change line 89 to:
[HTML]<td align="right">< input type=submit name="action1" value="Submit" onclick="submit Form2();"></td>[/HTML]
You've not actually made the change.
Change line 89 to:
[HTML]<td align="right">< input type=submit name="action1" value="Submit" onclick="submit Form2();"></td>[/HTML]
Hi,
Sorry, actually i have changed the one button code and not the other now this is working fine.
But still I am not clear why the same (wrong) code was working fine on Firefox.
Can you tell me the reason or some link where i can find out these differences between firefox and IE.
Thanks
Thanks a lot
acoder 16,027
Recognized Expert Moderator MVP
The situation is same as described in above post.
Now you've renamed the reset button to "action". Use a different name.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: chrisdude911 |
last post by:
how do i add video into a javascript web page with my own custom
buttons?
|
by: Coder |
last post by:
Hi I have the following code in java script, it is not giving proper
output in FIREFOX but running fine in IE... can anybody help me out to
make this run in FIREFOX .
<script language="JavaScript">
var cntlName;
var eleTarget = document.getElementById('hiding');
function showOrHide(){
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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: 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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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: 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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |