SubSonic Forums
All Your Database Are Belong To Us

<subsonic:Scaffold> DeleteConfirm

Latest post 12-30-2007 10:32 AM by awang. 2 replies.
  • 12-29-2007 11:34 AM

    • awang
    • Top 100 Contributor
    • Joined on 12-27-2007
    • Posts 20

    <subsonic:Scaffold> DeleteConfirm

    For some reason, the <subsonic:Scaffold> DeleteConfirm never worked for me. I thought it should give a popup message before end user can delete record. But it never shows any message.

    Please help!

     Alan

    Filed under:
  • 12-29-2007 9:43 PM In reply to

    Re: <subsonic:Scaffold> DeleteConfirm

    Reply |Contact |Answer

     Try putting this in to your page

     <script language="javascript" type="text/javascript">

    function CheckDelete()
    {
          return confirm('Delete this record? This action cannot be undone...');
    }


    function toggleAll(isChecked, control)
    {
       i = 0;
       var thisControl = document.getElementById(control + '_' + i);
       while(thisControl != null)
       {
            thisControl = document.getElementById(control + '_' + i);
           
            if(thisControl != null)
            {
                if(!thisControl.disabled)
                {
                    thisControl.checked = isChecked;
                }
                i++;
            }
       }
    }

    function imposeMaxLength(e, Object, MaxLen, rowIndex)
    {
        var keyCode = e.keyCode;
        var counter = document.getElementById('counter' + rowIndex);
        var charText = Object.value;
        var charCount = charText.length;
        var charRemain = MaxLen - charCount;
        counter.style.visibility = 'visible';
        if(keyCode == 8 || keyCode == 46)
        {
            if(charCount == MaxLen)
            {
                charRemain = 1;
            }
            else if(charCount == 0)
            {
                charRemain = MaxLen;
            }
            counter.innerHTML = charRemain;
            return true;
        }
        else
        {
            if(charRemain > 0)
            {
                counter.innerHTML = charRemain;
                return true;
            }
            else
            {
                Object.value = charText.substring(0, MaxLen);
                counter.innerHTML = '0';
                return false;
            }
        }
    }
     </script>

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

  • 12-30-2007 10:32 AM In reply to

    • awang
    • Top 100 Contributor
    • Joined on 12-27-2007
    • Posts 20

    Re: <subsonic:Scaffold> DeleteConfirm

     Thanks, it works.

     Alan

Page 1 of 1 (3 items) | RSS