Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z formularzem
motorolka24
post 27.04.2007, 16:56:48
Post #1





Grupa: Zarejestrowani
Postów: 90
Pomógł: 0
Dołączył: 21.04.2007

Ostrzeżenie: (0%)
-----


Witam. Mam taki problem. Chodzi o to ze jesli przy edycji pola pobiore dane do niego a nastepnie usune zeby pole bylo puste i dam ackeptuj to ma mi wyskoczyc alert 'wypelnij to pole'. Alert wyskakuje ale skrypt sie i tak wykonuje i modyfikuje mi na pole puste. Co trzeba zrobic zeby po wcisnieciu ok w alercie skrypt sie nie wykonal i mozna bylo dalej edytowac formularz??
  1. <script language="JavaScript" type="text/javascript">
  2. function a()
  3. {
  4. var b= document.forms.edytuj;
  5.  
  6. if(b.name.value == ""){
  7. alert('Wypelnij pole name');
  8. return ;
  9. }
  10. b.submit();
  11. }
  12.  
  13.  
  14. <form action="edytuj.php" name="edytuj" method="post">
  15. Name: <input type="text" maxlength=20 name="name" value="<?php echo $name; ?>"/><br />
  16. <?php echo"<input type='submit' value='Zmien' onClick='a();' />"; ?>
  17. </form>


Wie ktoś jak to zrobić??
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 10:56