السلام عليكم تجدون بالمرفقات صفحه
مصممها بواسطة الفرونت بيج
المطلوب حفظ خانة الناتج بحيث اذا دخلت لصفحه اجد اخر رقم اضفته
السلام عليكم تجدون بالمرفقات صفحه
مصممها بواسطة الفرونت بيج
المطلوب حفظ خانة الناتج بحيث اذا دخلت لصفحه اجد اخر رقم اضفته
هل السؤال صعب لهذه الدرجه
استعمل الكوكيز لحفظ هذه القيم، تفضل:
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8">
</head>
<script language="JavaScript">
// Visit our site at http://www.star28.com/ for more code
<!--
function a_plus_b(form) {
a=eval(form.a.value);
b=eval(form.b.value);
c=a+b;
form.ans.value = c;
}
function a_minus_b(form) {
a=eval(form.a.value);
b=eval(form.b.value);
c=a-b;
form.ans.value=c;
}
function a_times_b(form) {
a=eval(form.a.value);
b=eval(form.b.value);
c=a*b;
form.ans.value=c;
}
function a_div_b(form) {
a=eval(form.a.value);
b=eval(form.b.value);
c=a/b;
form.ans.value = c;
}
function a_pow_b(form) {
a=eval(form.a.value);
b=eval(form.b.value);
c=Math.pow(a, b);
form.ans.value = c;
}
function save_search_values() {
var txt1 = document.getElementById('txt1').value;
var txt2 = document.getElementById('txt2').value;
document.cookie = 'ppkcookie2=another test; expires=Fri, 3 Aug 2001 20:47:11 UTC; path=/';
document.cookie = "txt1=" + txt1 + ";expires=Fri, 3 Aug 2010 20:47:11 UTC;";
document.cookie = "txt2=" + txt2 + ";expires=Fri, 3 Aug 2010 20:47:11 UTC;";
}
function get_last_search_values() {
document.getElementById('txt1').value = getCookie('txt1');
document.getElementById('txt2').value = getCookie('txt2');
}
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
</script>
<body onload="get_last_search_values()">
<div align="center">
<form name="formx">
<span lang="ar-sa">المطلوب الحفظ بخانة الناتج بحيث اذا قفلت الصفحه احصل نفس الناتج الاخير الي ادخلته </span>
<input type="number" value="0" name="ans" size="9">
<input type="number" id="txt1" size="4" value="1" name="b">+
<input type="text" id="txt2" size="4" value="1" name="a">
<p> <input type="button" value="الناتج" onClick="a_plus_b(this.form); save_search_values();"> </p>
</form>
</div>
</body>تم تعديل هذه المشاركة بواسطة خالد_الحوراني في 30 نوفمبر 2008 في 00:42
ماشالله عليك
يعطيك العافيه
عزيز هذه خطوه قريبه ولكن اريد حفظ بيانات الناتج