Javascript ile form göndermek !

Herzaman için formumuza bir submit butonu ve tıklayınca gönder şeklinde uygulamalar yapmayız bazende gönder butonu yerine resim kullanmak hatta bir link koymak isteriz . Peki burada işte gönderme işlemi nasıl olacak ? Burada imdadımıza javascript yetişiyor işte javascript ile form verilerini göndermemize yarayan kod parçacığı ...

İşte Kodumuz :

PHP:
  1. <form name="forum_adi" action="islem.php">
  2. <input type='text' name='adi_soyadi'>
  3. <A href="javascript: submitform()">Gönder</A>
  4. </form>
  5.  
  6. ## İşte submitform() fonksiyonumuz
  7.  
  8. <SCRIPT language="JavaScript">
  9. function submitform()
  10. {
  11.   document.forum_adi.submit();
  12. }
  13. </SCRIPT>

Kolay gelsin ;)

74 views

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word