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

This works in IE but not FF

P: n/a
I have this simple little script that submits a page where some
server-side scripting deletes a record from a database. This works as
expected in IE but it appears that, in FF, the submit is not occurring
(I'm receiving nothing at the server). FWIW, the "confirm" dialog does
pop up and I can click OK/Cancel - but nothing happens after that.

What am I doing wrong?
function DoDelete(x)
{
var resp = confirm('Delete ' + x + '? - Are You Sure?');
if (resp)
{
document.all['deleteThis'].value=x;
document.forms.frmDisplay.submit();
}
}
Oct 9 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Martin wrote:
I have this simple little script that submits a page where some
server-side scripting deletes a record from a database. This works as
expected in IE but it appears that, in FF, the submit is not occurring
(I'm receiving nothing at the server). FWIW, the "confirm" dialog does
pop up and I can click OK/Cancel - but nothing happens after that.

What am I doing wrong?
You are using IE proprietary syntax:
document.all['deleteThis'].value=x; <----
What is "x", a form control?

Mick


function DoDelete(x)
{
var resp = confirm('Delete ' + x + '? - Are You Sure?');
if (resp)
{
document.all['deleteThis'].value=x;
document.forms.frmDisplay.submit();
}
}

Oct 9 '05 #2

P: n/a
Martin wrote:
This works as expected in IE but it appears that, in FF, the submit is not
occurring document.all['deleteThis'].value=x;


http://www.mozilla.org/docs/web-deve...tml#dom_unsupp

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Oct 9 '05 #3

P: n/a
Mick / David -

Thanks for the response but I still can't get this thing to submit. I
understand what you're saying about the IE-specific syntax. I changed
the way the passed-in value is assigned but the script still does not
submit in Firefox. Here's what I changed it to:

document.getElementById('deleteThis').value=x;

I've also changed the .submit statement to this:

document.forms['frmDisplay'].submit();

but, it didn't seem to make any difference.
BTW, here's the statement that calls the DoDelete function:

<input type="button" name="delIt" value="Delete This Record"
onclick="DoDelete("MyValue");

where "MyValue" is the data that is used by the server-side script to
find the proper record in the database.
Can anyone tell me what the problem is here?

Thanks again.
On Sun, 09 Oct 2005 18:18:08 +0100, David Dorward <do*****@yahoo.com>
wrote:
Martin wrote:
This works as expected in IE but it appears that, in FF, the submit is not
occurring

document.all['deleteThis'].value=x;


http://www.mozilla.org/docs/web-deve...tml#dom_unsupp


Oct 10 '05 #4

P: n/a
Martin wrote:
Mick / David -

Thanks for the response but I still can't get this thing to submit. I
understand what you're saying about the IE-specific syntax. I changed
the way the passed-in value is assigned but the script still does not
submit in Firefox. Here's what I changed it to:

document.getElementById('deleteThis').value=x;

I've also changed the .submit statement to this:

document.forms['frmDisplay'].submit();

but, it didn't seem to make any difference.
BTW, here's the statement that calls the DoDelete function:

<input type="button" name="delIt" value="Delete This Record"
onclick="DoDelete("MyValue");
onclick="DoDelete("MyValue");

Should be something like the following:
onclick='DoDelete("MyValue");'

Without knowing what the function is trying to accomplish, it's
difficult to say what else may be wrong.
Mick

where "MyValue" is the data that is used by the server-side script to
find the proper record in the database.
Can anyone tell me what the problem is here?

Thanks again.
On Sun, 09 Oct 2005 18:18:08 +0100, David Dorward <do*****@yahoo.com>
wrote:

Martin wrote:

This works as expected in IE but it appears that, in FF, the submit is not
occurring

document.all['deleteThis'].value=x;


http://www.mozilla.org/docs/web-deve...tml#dom_unsupp


Oct 10 '05 #5

P: n/a
On Mon, 10 Oct 2005 17:09:04 GMT, Mick White
<mw***********@rochester.rr.com> wrote:
Martin wrote:
Mick / David -

Thanks for the response but I still can't get this thing to submit. I
understand what you're saying about the IE-specific syntax. I changed
the way the passed-in value is assigned but the script still does not
submit in Firefox. Here's what I changed it to:

document.getElementById('deleteThis').value=x;

I've also changed the .submit statement to this:

document.forms['frmDisplay'].submit();

but, it didn't seem to make any difference.
BTW, here's the statement that calls the DoDelete function:

<input type="button" name="delIt" value="Delete This Record"
onclick="DoDelete("MyValue");
onclick="DoDelete("MyValue");

Should be something like the following:
onclick='DoDelete("MyValue");'


Yes, you're correct. That was just a typo that occurred when I wrote
the newsgroup message.
Without knowing what the function is trying to accomplish, it's
difficult to say what else may be wrong.
Mick


Here's the entire function (with the modified statements as suggested
earlier):

function DoDelete(x)
{
var resp = confirm('Delete ' + x + '? - Are You Sure?');
if (resp)
{
document.all['deleteThis'].value=x;
document.forms['frmDisplay'].submit();
}
}

The function executes OK; the problem is that the "submit" does not
occur when the page is being viewed in Firefox.
Any suggestions?


where "MyValue" is the data that is used by the server-side script to
find the proper record in the database.
Can anyone tell me what the problem is here?

Thanks again.
On Sun, 09 Oct 2005 18:18:08 +0100, David Dorward <do*****@yahoo.com>
wrote:

Martin wrote:
This works as expected in IE but it appears that, in FF, the submit is not
occurring

document.all['deleteThis'].value=x;

http://www.mozilla.org/docs/web-deve...tml#dom_unsupp



Oct 10 '05 #6

P: n/a
OK, finally figured this out. These lines work in Firefox:

document.forms['frmDisplay'].elements['deleteThis'].value=x;
document.forms['frmDisplay'].submit();

On Sun, 09 Oct 2005 09:26:48 -0700, Martin <ma**********@comcast.net>
wrote:
I have this simple little script that submits a page where some
server-side scripting deletes a record from a database. This works as
expected in IE but it appears that, in FF, the submit is not occurring
(I'm receiving nothing at the server). FWIW, the "confirm" dialog does
pop up and I can click OK/Cancel - but nothing happens after that.

What am I doing wrong?
function DoDelete(x)
{
var resp = confirm('Delete ' + x + '? - Are You Sure?');
if (resp)
{
document.all['deleteThis'].value=x;
document.forms.frmDisplay.submit();
}
}


Oct 10 '05 #7

P: n/a
Martin said the following on 10/10/2005 4:38 PM:
OK, finally figured this out. These lines work in Firefox:

document.forms['frmDisplay'].elements['deleteThis'].value=x;
document.forms['frmDisplay'].submit();


Imagine that. It works in any other browser as well. And it only took
you 4 or 5 posts to figure out what you were told in the first one. Now,
if we can teach you to not top-post..

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Oct 10 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.