MSHAER
08-11-2007, 11:27 PM
[شرح]انشاء اكثر من زر في نموذج حقل ادخال البيانات باستخدام الجافا سكربت
مثال
3547
انشاء الفورم
<form method="POST" id="forems">
محتوى الفورم هنا
مثل حقل نصي أو حقل خيارات على كيفك
<DIV align="center"> <input type="submit" value="حذف المواقع" name="B1" onclick="other3();"> <input type="submit" value="تعديل" name="B1" onclick="other2();"><input type="submit" value="تفعيل المواقع" name="B2" onclick="other();"> <input type="reset" value="ألغاء الأختيار" name="B2">
</form><script language="javascript">
<!--
function other(){
document.getElementById('forems').action="index.php?action=tf3el2";
}
function other2(){
document.getElementById('forems').action="index.php?action=editsait";
}
function other3(){
document.getElementById('forems').action="index.php?action=deletsait";
}
//-->
</script> </form>
لاحظ معي استخدام الجاف سكربت التالي
<script language="javascript">
<!--
function other(){
document.getElementById('forems').action="index.php?action=tf3el2";
}
function other2(){
document.getElementById('forems').action="index.php?action=editsait";
}
function other3(){
document.getElementById('forems').action="index.php?action=deletsait";
}
//-->
</script>
وظيفة كل زر انت تحددها يعني وين بتنتقل عند الظغط
لاحظ معي الازره المستخدم
الفنكشن الأول
function other(){
document.getElementById('forems').action="index.php?action=tf3el2";
}
وجهناه لهالرابط عند الظغط
index.php?action=tf3el2
اما الفنكشن الثاني
function other2(){
document.getElementById('forems').action="index.php?action=editsait";
}
وجهناه لهالرابط عند الظغط
index.php?action=editsait
أما الفنكشن الثالث
function other3(){
document.getElementById('forems').action="index.php?action=deletsait";
}
وجهناه لهالرابط عند الظغط
index.php?action=deletsait
وتستطيع زيادة الخيارات انشأ فنكشن الى مالانهايه
هذا الزر عند الظغط نوجهه للكائن
other3();
<input type="submit" value="تعديل" name="B1" onclick="other2();">
هذا الزر نوجهه للكائن
other2();
<input type="submit" value="تفعيل المواقع" name="B2" onclick="other();">
هذا الزر نوجهه للكائن
other2();
هذا الزر لاعادة تعييين الخانات ( تصفيرها يعني )
<input type="reset" value="ألغاء الأختيار" name="B2">
اي أسئله انا حاضر ومعاكم الى أن يتوفانا الله برحمته
دعواتكم لنا بالتوفيق والهدايه فنحن على أبواب رمضان الخير والمغفره
مثال
3547
انشاء الفورم
<form method="POST" id="forems">
محتوى الفورم هنا
مثل حقل نصي أو حقل خيارات على كيفك
<DIV align="center"> <input type="submit" value="حذف المواقع" name="B1" onclick="other3();"> <input type="submit" value="تعديل" name="B1" onclick="other2();"><input type="submit" value="تفعيل المواقع" name="B2" onclick="other();"> <input type="reset" value="ألغاء الأختيار" name="B2">
</form><script language="javascript">
<!--
function other(){
document.getElementById('forems').action="index.php?action=tf3el2";
}
function other2(){
document.getElementById('forems').action="index.php?action=editsait";
}
function other3(){
document.getElementById('forems').action="index.php?action=deletsait";
}
//-->
</script> </form>
لاحظ معي استخدام الجاف سكربت التالي
<script language="javascript">
<!--
function other(){
document.getElementById('forems').action="index.php?action=tf3el2";
}
function other2(){
document.getElementById('forems').action="index.php?action=editsait";
}
function other3(){
document.getElementById('forems').action="index.php?action=deletsait";
}
//-->
</script>
وظيفة كل زر انت تحددها يعني وين بتنتقل عند الظغط
لاحظ معي الازره المستخدم
الفنكشن الأول
function other(){
document.getElementById('forems').action="index.php?action=tf3el2";
}
وجهناه لهالرابط عند الظغط
index.php?action=tf3el2
اما الفنكشن الثاني
function other2(){
document.getElementById('forems').action="index.php?action=editsait";
}
وجهناه لهالرابط عند الظغط
index.php?action=editsait
أما الفنكشن الثالث
function other3(){
document.getElementById('forems').action="index.php?action=deletsait";
}
وجهناه لهالرابط عند الظغط
index.php?action=deletsait
وتستطيع زيادة الخيارات انشأ فنكشن الى مالانهايه
هذا الزر عند الظغط نوجهه للكائن
other3();
<input type="submit" value="تعديل" name="B1" onclick="other2();">
هذا الزر نوجهه للكائن
other2();
<input type="submit" value="تفعيل المواقع" name="B2" onclick="other();">
هذا الزر نوجهه للكائن
other2();
هذا الزر لاعادة تعييين الخانات ( تصفيرها يعني )
<input type="reset" value="ألغاء الأختيار" name="B2">
اي أسئله انا حاضر ومعاكم الى أن يتوفانا الله برحمته
دعواتكم لنا بالتوفيق والهدايه فنحن على أبواب رمضان الخير والمغفره