JS削除確認整理収集
3986 ワード
// web , , , <head></head> javascript
< script language = "JavaScript" > function delete_confirm(e)
{
if (event.srcElement.outerText == " ")
event.returnValue = confirm(" ?");
}
document.onclick = delete_confirm;
</script>
//----------------------------------------------------------------------------------------------------------------------------//簡単に通用するJS削除確認関数/フォントサイズ:小中大 <script language = "javascript"> function delID(ID, url, mes)
{
var mymes;
mymes = confirm(mes);
if (mymes == true)
{
window.location = url + ID;
}
}
</script>
//呼び出し方法<a href=# onclick="delID(5,'delete.asp?id=',' ?')">test</test>
//これは個人的にずっと使っています.<a href="#" Onclick="javascript:{if (confirm(' ?
!!!')){self.location='Save_Class.asp?Action=Del_Class&ClassID=<%=Rs("AnClassID")%>';}}"> </a>
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------一般的には以下の通りです.<a href="del.php" onclick="return(confirm(" ?"))">Del</a>
//しかし、ボタンで削除する必要がある場合があります.フォームではなく、簡単な方法があります.function delID(ID, url, mes)
{
var mymes;
mymes = confirm(mes);
if (mymes == true)
{
window.location = url + ID;
}
}
//<input name="Del" type="button" id="Del" value=" " onClick="delID([var.qid],"Del.php?id="," !")">
function delcfm()
{
if (!confirm(" ?"))
{
window.event.returnValue = false;
}
}
//
//<a href="delete.php?id=5" onclick="delcfm()">test</a>
//---------------------------------<script language=javascript>
function count_checked_items()
{
var number_checked=0;
var box_count=document.form1.articleID.length;
if ( box_count==null )
{
if ( document.form1.articleID.checked==true )
{
number_checked=1;}
else {
number_checked=0;}
}
else {
for ( var i=0; i < (box_count); i++ ) {
if ( document.form1.articleID[i].checked==true ) {
number_checked++;}}}
return number_checked;
}
function SubmitForm() {
if (count_checked_items()>0){
if(confirm(" ?")){
document.form1.action="../makehtml/Make_article_Detail.asp";
document.form1.submit();
}
}
else
alert(' !');
return false;
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</script>
// <input name="chkAll" type="checkbox" id="chkAll2" onClick="CheckAll(form1)" value="checkbox">