Confirm, array in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • norfernuman

    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,ta ble,col_id,id,c onf_id) {
    var myArray = [table, col_id, id, conf_id];
    var msg = "Do you really want to delete record " + name + " ? ";

    if (confirm(msg))
    location.replac e("$page?bk=cus t&view=del&data =" + myArray);
    }

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

    <a href=\"javascri pt:;\" onclick=\"delWa rn('This
    Record','$table ','$del_col_nam e','$row_id','$ id');\">Delete</a>
  • Lee

    #2
    Re: Confirm, array in IE

    norfernuman said:[color=blue]
    >
    >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,ta ble,col_id,id,c onf_id) {
    > var myArray = [table, col_id, id, conf_id];
    > var msg = "Do you really want to delete record " + name + " ? ";
    >
    > if (confirm(msg))
    > location.replac e("$page?bk=cus t&view=del&data =" + myArray);
    >}
    >
    >Here is the php generated link I am using: ( my email client wraps it )
    >
    ><a href=\"javascri pt:;\" onclick=\"delWa rn('This
    >Record','$tabl e','$del_col_na me','$row_id',' $id');\">Delete </a>[/color]


    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,$de l_col_name,$row _id\"
    onclick=\"retur n confirm('Do you really want to delete This
    Record?')\">Del ete</a>

    Comment

    • norfernuman

      #3
      Re: Confirm, array in IE

      Lee wrote:
      [color=blue]
      > 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,$de l_col_name,$row _id\"
      > onclick=\"retur n confirm('Do you really want to delete This
      > Record?')\">Del ete</a>
      >[/color]

      Thank you very much!

      This works great.

      - NN

      Comment

      Working...