Ushtrim_12_Maj_Iljaz Tuma.txt

Shkarkuar 413 herë. Ngarkuar më Maj 2012

Shkarko Kthehu ne Sisteme Multimediale
<html>
<!-- Ndertoni nje faqe web ne te cilen perdoruesi duhet te vendose daten e lindjes, 
     me ane te tre combo boxeve, perkatesisht per diten muajin dhe vitin, 
	 dhe faqja duhet te kete nje buton, qe kur shtypet afishon nej mesazh per perdoruesin:
     Nqs ditelindja eshte me e vogel se data aktuale, llogarit sa vite kane kaluar 
	    dhe afishon "Kane kaluar ... vite"
	 Nqs ditelindja eshte me e madhe se data aktuale, afishon "Gabim: Ditelindja nuk eshte e sakte!"	
	  -->
  <body>
  <h2>    Jepni ditelindjen</h2>
  <script language="JavaScript">
  function  kontrolloDaten()
  {
     var myDate=new Date()
	 var dataSot=new Date()
	 myDate.setFullYear(document.forms[2].select.value,document.forms[1].select.value,document.forms[0].select.value)
    if(myDate>dataSot)
	  alert("Gabim: Ditelindja nuk eshte e sakte!")
	  else if(myDate<dataSot)
	  alert("Datat eshte me e vogel\n  kane kaluar:  " +eval(dataSot.getFullYear()-myDate.getFullYear())+" vite")
	  else 
        alert(" Keni zgjedhur daten e sotme!")
  }
  </script>
   <form>
     <script language="JavaScript">
	 document.write("<select name='select'>");
	 for(i=1;i<=31;i++)
	  document.write("<option value='"+i+"'>"+i+"</option>");
	 document.write("</select>"); 
	 </script>
	 </form>
   <form>
     <select name="select">
	 <option value="0">Janar</option>
	 <option value="1">Shkurt</option>
	 <option value="2">Mars</option>
	 <option value="3">Prill</option>
	 <option value="4">Maj</option>
	 <option value="5">Qeshor</option>
	 <option value="6">Korik</option>
	 <option value="7">Gusht</option>
	 <option value="8">Shtator</option>
	 <option value="9">Tetor</option>
	 <option value="10">Nentor</option>
	 <option value="11">Dhjetor</option>
	 </select>
   </form>
   <form>
   <script language="JavaScript">
     var myDate=new Date();
	 var viti = eval(myDate.getFullYear());
	 document.write("<select name='select'>");
	 for(i=1980;i<=viti;i++)
	  document.write("<option value='"+i+"'>"+i+"</option>");
	 document.write("</select>"); 
	 </script>
  
   </form>
   <form>
     <input type="Button" value="Kontrollo" onclick="kontrolloDaten();">
   </form>
  </body>
</html>