471,571 Members | 1,238 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Confirm, array in IE

This function works fine in all mozilla based browsers, but in IE6
the confirm shows up, but it doesn't change location, is there a way to
tweak this for IE and Mozilla use?

Thanks,
- NN
<code>
I am using this function:

function delWarn(name,table,col_id,id,conf_id) {
var myArray = [table, col_id, id, conf_id];
var msg = "Do you really want to delete record " + name + " ? ";

if (confirm(msg))
location.replace("$page?bk=cust&view=del&data=" + myArray);
}

Here is the php generated link I am using: ( my email client wraps it )

<a href=\"javascript:;\" onclick=\"delWarn('This
Record','$table','$del_col_name','$row_id','$id'); \">Delete</a>
Jul 23 '05 #1
2 1178
Lee
norfernuman said:

This function works fine in all mozilla based browsers, but in IE6
the confirm shows up, but it doesn't change location, is there a way to
tweak this for IE and Mozilla use?

Thanks,
- NN
<code>
I am using this function:

function delWarn(name,table,col_id,id,conf_id) {
var myArray = [table, col_id, id, conf_id];
var msg = "Do you really want to delete record " + name + " ? ";

if (confirm(msg))
location.replace("$page?bk=cust&view=del&data=" + myArray);
}

Here is the php generated link I am using: ( my email client wraps it )

<a href=\"javascript:;\" onclick=\"delWarn('This
Record','$table','$del_col_name','$row_id','$id') ;\">Delete</a>

1. You shouldn't use the "javascript:" protocol like that.
2. If you don't want a link to be followed, you should have the
onclick event handler return false.
3. Much simpler (subject to typos):

<a href=\"$page?bk=cust&view=del&data=$table,$del_col _name,$row_id\"
onclick=\"return confirm('Do you really want to delete This
Record?')\">Delete</a>

Jul 23 '05 #2
Lee wrote:
1. You shouldn't use the "javascript:" protocol like that.
2. If you don't want a link to be followed, you should have the
onclick event handler return false.
3. Much simpler (subject to typos):

<a href=\"$page?bk=cust&view=del&data=$table,$del_col _name,$row_id\"
onclick=\"return confirm('Do you really want to delete This
Record?')\">Delete</a>


Thank you very much!

This works great.

- NN
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Logger | last post: by
13 posts views Thread by LRW | last post: by
1 post views Thread by freshRecruit | last post: by
1 post views Thread by chris | last post: by
4 posts views Thread by tfsmag | last post: by
8 posts views Thread by rn5a | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by

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.