473,503 Members | 479 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(document.EditForm);

if (validateOK==true) {
theAction = document.EditForm.action;
if ( theAction.indexOf('?') == -1 ) {
if ( theAction.indexOf('#') == -1 ) {
document.EditForm.action = theAction + "?__haction=apply"
} else {
posit = theAction.indexOf('#')
document.EditForm.action = theAction.substring(0,posit) +
"?__haction=apply" + theAction.substring(posit,theAction.length)
}
} else {
posit = theAction.indexOf('?')
document.EditForm.action = theAction.substring(0,posit+1) +
"__haction=apply&" + theAction.substring(posit+1,theAction.length)
}
document.EditForm.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 3532
su************@gmail.com wrote:
Hi,

On IE7 I'm using a script:

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

if (validateOK==true) {
theAction = document.EditForm.action;
if ( theAction.indexOf('?') == -1 ) {
if ( theAction.indexOf('#') == -1 ) {
document.EditForm.action = theAction + "?__haction=apply"
} else {
posit = theAction.indexOf('#')
document.EditForm.action = theAction.substring(0,posit) +
"?__haction=apply" + theAction.substring(posit,theAction.length)
}
} else {
posit = theAction.indexOf('?')
document.EditForm.action = theAction.substring(0,posit+1) +
"__haction=apply&" + theAction.substring(posit+1,theAction.length)
}
document.EditForm.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=".document.forms.EditForm.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_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
suneet.tapa...@gmail.com wrote:
Hi,
On IE7 I'm using a script:
function saveValues()
{
var validateOK=true;
if (typeof validate !='undefined')
validateOK = validate(document.EditForm);
if (validateOK==true) {
theAction = document.EditForm.action;
if ( theAction.indexOf('?') == -1 ) {
if ( theAction.indexOf('#') == -1 ) {
document.EditForm.action = theAction + "?__haction=apply"
} else {
posit = theAction.indexOf('#')
document.EditForm.action = theAction.substring(0,posit) +
"?__haction=apply" + theAction.substring(posit,theAction.length)
}
} else {
posit = theAction.indexOf('?')
document.EditForm.action = theAction.substring(0,posit+1) +
"__haction=apply&" + theAction.substring(posit+1,theAction.length)
}
document.EditForm.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=".document.forms.EditForm.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
4242
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...
1
19597
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...
1
4604
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...
1
1998
by: christina.saavedra | last post by:
Hi! I want to send parameters from a javascript to a servlet. Could anyone help me? Thanx
7
11043
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,...
9
41696
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
4104
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...
1
3376
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...
2
3426
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...
0
7089
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
7339
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...
0
7463
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...
0
5581
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,...
1
5017
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...
0
4678
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
3168
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...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
389
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.