javascript parameters not reaching the servlet while using IE7

S

suneet.taparia

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
 
E

Erwin Moller

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
 
S

suneet.taparia

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..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top