By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,564 Members | 906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,564 IT Pros & Developers. It's quick & easy.

javascript parameters not reaching the servlet while using IE7

P: n/a
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
Share this Question
Share on Google+
2 Replies

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.