469,306 Members | 1,628 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

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 1145
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.