473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

This works in IE but not FF

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
7 1305
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Randy Weber | last post by:
I have a page with two frames, 'header' and 'main'. The following code works in Netscape, but in Internet Explorer. The second bgColor line produces an error: function test(){...
2
by: deko | last post by:
Has anyone been able to import data from Claris Works into Access 2002? Is it simply a matter of exporting the Claris Works data into a comma delimited file and mapping the fields? Thanks in...
1
by: | last post by:
I got about half way through a project using Access from Microsoft Office when they decided they wanted to use Works instead. I looked at the db in works and it looks woefully inadequate. I could...
4
by: craigkenisston | last post by:
Looking for Internet Componets : anything comparable to IP Works? Hi, I need a suite of components that provided me with SMPT, POP3, NNTP, Telnet and Ping protocols. I have been looking and...
2
by: Enrique Bustamante | last post by:
Casting arrays that works on watch and command window but not in code. My application is casting arrays in a way it should work. To test if I was doing something invalid, I wrote a test code that...
1
by: chris huff via .NET 247 | last post by:
I have a primary user who does NOT have ms Excel. He runs MSWorks and uses the spreadsheet program within it. My vb.net application is focused around a price sheet that theuser updates via their...
1
by: Samuel | last post by:
Why my Crystal Report form works on the machine I installed VB.NET, not works on the machine without VB.NET? Thanks.
1
by: thubba2000 | last post by:
We have a web application developed using IBuySpy. In older versions, Autocomplete on all web forms works. In our latest version, it stopped working on all clients. I have gone through all the...
28
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
6
by: dthompson | last post by:
I have written a service designed to run on 2003 Servers, in development it works 100% on my Windows XP system. Once deployed to 2003 I keep getting the same error (File Not Found, error 53)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...

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.