Prikazi cijelu temu 30.05.2016 21:14
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Re: web strana pocetok
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Moja prva stranica</TITLE>
  3.  
  4. </HEAD>
  5. <BODY bgcolor="#998066">
  6.  <form name="mojaforma" method="POST" action="provjera.php"><br />
  7.         Ime: <input name="ime" type="text" /><br />
  8.         Å ifra:<input name="sifra" type="text" /><br />
  9.         <input type="submit" value="PoÅ¡alji" name="posalji">
  10. </form>
  11. <script type="text/javascript" language="javascript">
  12. document.getElementsByTagName('input')[1].onkeypress = function(e) {
  13.   e = e || event
  14.   var chr = getChar(e)  
  15.   if (!isNumeric(chr) && chr !== null) {
  16.    return false
  17.  }
  18. }
  19. function isNumeric(val) {
  20.  return val !== "NaN" && (+val)+'' === val + ''
  21. }
  22.  
  23. function getChar(event) {
  24.  if (event.which == null) {
  25.    return String.fromCharCode(event.keyCode) // IE
  26.  } else if (event.which!=0 && event.charCode!=0) {
  27.    return String.fromCharCode(event.which)  
  28.  } else {
  29.    return null
  30.  }
  31.  }  
  32.  </script>
  33. </BODY>
  34. </HTML>

Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.