473,836 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript parameters not reaching the servlet while using IE7

Hi,

On IE7 I'm using a script:

function saveValues()
{
var validateOK=true ;
if (typeof validate !='undefined')
validateOK = validate(docume nt.EditForm);

if (validateOK==tr ue) {
theAction = document.EditFo rm.action;
if ( theAction.index Of('?') == -1 ) {
if ( theAction.index Of('#') == -1 ) {
document.EditFo rm.action = theAction + "?__haction=app ly"
} else {
posit = theAction.index Of('#')
document.EditFo rm.action = theAction.subst ring(0,posit) +
"?__haction=app ly" + theAction.subst ring(posit,theA ction.length)
}
} else {
posit = theAction.index Of('?')
document.EditFo rm.action = theAction.subst ring(0,posit+1) +
"__haction=appl y&" + theAction.subst ring(posit+1,th eAction.length)
}
document.EditFo rm.submit();
}
}

but the http parameters are not reaching the servlet.But this works
absolutely fine on IE6

what could be the possibilites for this script faliure.

Thanks in advance

Feb 2 '07 #1
2 3548
su************@ gmail.com wrote:
Hi,

On IE7 I'm using a script:

function saveValues()
{
var validateOK=true ;
if (typeof validate !='undefined')
validateOK = validate(docume nt.EditForm);

if (validateOK==tr ue) {
theAction = document.EditFo rm.action;
if ( theAction.index Of('?') == -1 ) {
if ( theAction.index Of('#') == -1 ) {
document.EditFo rm.action = theAction + "?__haction=app ly"
} else {
posit = theAction.index Of('#')
document.EditFo rm.action = theAction.subst ring(0,posit) +
"?__haction=app ly" + theAction.subst ring(posit,theA ction.length)
}
} else {
posit = theAction.index Of('?')
document.EditFo rm.action = theAction.subst ring(0,posit+1) +
"__haction=appl y&" + theAction.subst ring(posit+1,th eAction.length)
}
document.EditFo rm.submit();
}
}

but the http parameters are not reaching the servlet.But this works
absolutely fine on IE6

what could be the possibilites for this script faliure.

Thanks in advance
Hi,
2 thing you can look at:

1) Whitout diving into your substringlogic and hashes, why don't you simply
alert the action before submitting to check if the URL makes sense?
Like this:
alert ("action=".docu ment.forms.Edit Form.action);
document.forms. EditForm.submit ();

I mean, you claim it works allright, but did you check this?

2) Also [guessing], you are probably passing POST-form parameters too, but
you didn't show all the code.
It has been a long time since I last worked on J2EE/servlets, but could this
confuse the servlet?
Maybe it makes more sense to pass your info as a POST or as a GET, and not
both.

Regards,
Erwin Moller

Feb 2 '07 #2
On Feb 2, 2:05 pm, Erwin Moller
<since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
suneet.tapa...@ gmail.com wrote:
Hi,
On IE7 I'm using a script:
function saveValues()
{
var validateOK=true ;
if (typeof validate !='undefined')
validateOK = validate(docume nt.EditForm);
if (validateOK==tr ue) {
theAction = document.EditFo rm.action;
if ( theAction.index Of('?') == -1 ) {
if ( theAction.index Of('#') == -1 ) {
document.EditFo rm.action = theAction + "?__haction=app ly"
} else {
posit = theAction.index Of('#')
document.EditFo rm.action = theAction.subst ring(0,posit) +
"?__haction=app ly" + theAction.subst ring(posit,theA ction.length)
}
} else {
posit = theAction.index Of('?')
document.EditFo rm.action = theAction.subst ring(0,posit+1) +
"__haction=appl y&" + theAction.subst ring(posit+1,th eAction.length)
}
document.EditFo rm.submit();
}
}
but the http parameters are not reaching the servlet.But this works
absolutely fine on IE6
what could be the possibilites for this script faliure.
Thanks in advance

Hi,
2 thing you can look at:

1) Whitout diving into your substringlogic and hashes, why don't you simply
alert the action before submitting to check if the URL makes sense?
Like this:
alert ("action=".docu ment.forms.Edit Form.action);
document.forms. EditForm.submit ();

I mean, you claim it works allright, but did you check this?

2) Also [guessing], you are probably passing POST-form parameters too, but
you didn't show all the code.
It has been a long time since I last worked on J2EE/servlets, but could this
confuse the servlet?
Maybe it makes more sense to pass your info as a POST or as a GET, and not
both.

Regards,
Erwin Moller- Hide quoted text -

- Show quoted text -
Thanks Erwin,

I'll try doing what you've suggested..

Feb 5 '07 #3

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

Similar topics

5
4274
by: Patrick | last post by:
I am trying to download the html page at http://www.dreamteamfc.com/dtfc04/servlet/PostPlayerList?catidx=1 Using the code public class DownloadWebPage { public static void main (String args) throws IOException { URL url = new
1
19614
by: Barry Parker | last post by:
Is there a way to pass parameters (variables?) from a JSP page to a servlet when it is called? This way I can use a generic servlet to do several different tasks. The call to the servlet is made by using the JSP forward tag. Cheers in advance, Barry
1
4615
by: Matthew Flower | last post by:
I'd like to generate a JavaScript file from a servlet. Mozilla 1.5 seems to have no problem with this, but IE 6.0 is not cooperating. I've created a very simple test servlet that writes one line: alert("hello"); I have an HTML page that looks like this: <html><head> <script language="javascript" src="/servlet/Test"></script> </head></html>
1
2020
by: christina.saavedra | last post by:
Hi! I want to send parameters from a javascript to a servlet. Could anyone help me? Thanx
7
11096
by: Oleg Konovalov | last post by:
Hi, I am trying to pass a bunch of checked checkboxes (Javascript array) from page1 to the Java action class on subsequent web page (page2). (on page 1 I have a bunch of DB rows with a checkbox, need to iterate through pages page2 - e.g. allow user to update the fields there) On page1 I have a bunch of checkboxes with the same name v1 but different values (= DB rowId).
9
41723
by: misdst23 | last post by:
Hi, I know I can call a static java method within javascript by using the <% ... %tags. But how can pass a javascript variable ? function thefunction() { var = javascriptvariable ;
9
4139
by: ajos | last post by:
hi all, im getting some problems in my javascript validations..... my jsp code--> 8: <head> 9: <title>Budget Master Administration</title> 10: <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> 11: <html:javascript src="bscript.js" method="everything(this)" staticJavascript="false"/> 12: <!-- <SCRIPT LANGUAGE="JavaScript" SRC="bscript.js"></SCRIPT> --> 13: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
1
3390
by: Silgd1 | last post by:
Hi All, I am trying to pass parameters from a mutiple selection listbox contained in a visual web jsf page to a servlet. I am using netbeans 6.0.1, and already have a method written in the java portion of the jsf page to get the selected item from the listbox and return them as a string. An example of the returned string looks like this '(8, 10, 11)'. I need to pass the string to a servlet where they will be used by a method in another...
2
3460
by: ManidipSengupta | last post by:
Hi, a few (3) questions for the Java experts, and let me know if this is the right forum. It deals with 100% java code (reason for posting here) but manages a Web browser with Javascript. Thanks in advance for responding. I have made a stub of the codes for better understanding. Situation: I have a Java servlet (HelloWorldServlet) running on a Tomcat (5.5.26) server on a Linux machine (compiled in JDK1.4.2). It writes Javascript to construct...
0
9810
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, 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...
0
9656
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,...
0
10821
Oralloy
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...
0
10527
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 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...
1
10571
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,...
0
10241
tracyyun
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...
1
7773
isladogs
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...
0
6973
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();...
2
4001
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.