Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ajax] input type=file
lenczewski
post
Post #1





Grupa: Zarejestrowani
Postów: 159
Pomógł: 1
Dołączył: 31.08.2005

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


witam mam kod (sciągnełem z jakieś strony), dodałem pole typu FILE, ale nie wiem dlaczego nie przekazuje go do dalszej części
  1. <? $sid = md5( uniqid( rand(), true ) ); ?>
  2.  
  3. <form method="post" action="upload.php" id="<?=$sid?>">
  4. <input type="hidden" name="act" value="post">
  5.  
  6. <input type="file" name="img" value="">
  7.  
  8. <input type="hidden" name="SUBMIT" value="">
  9. <input type="submit" name="zapisz" value="Zapisz" onClick="ajaxform( '<?=$sid?>', 'ZAPISZ' );"/>
  10. </form>


Funkcja do której to idzie:

  1. function ajaxform( nameID, submitvalue, ResponseId )
  2. {
  3. if ( document.getElementById(nameID).SUBMIT != "undefined" )
  4. {
  5. document.getElementById(nameID).SUBMIT.value = submitvalue;
  6. }
  7.  
  8. if( ResponseId == undefined )
  9. {
  10. ResponseId = 'contentAJAX';
  11. }
  12.  
  13. if ( arrElement[nameID] != 1 )
  14. {
  15. advAJAX.assign(document.getElementById(nameID), {
  16. onLoading : function() {
  17. contentHTML = document.getElementById( ResponseId ).innerHTML;
  18. document.getElementById( ResponseId ).innerHTML = document.getElementById( 'loadtemplate2' ).innerHTML;
  19. },
  20. onSuccess : function(obj) {
  21. document.getElementById( ResponseId ).innerHTML = obj.responseText;
  22. ajaxDebug( obj.responseText );
  23. },
  24. onError : function(obj) {
  25. document.getElementById( ResponseId ).innerHTML = contentHTML;
  26. window.alert('Wystąpił nieoczekiwany błąd. Powtórz operację.');
  27. }
  28. });
  29. }
  30.  
  31. if (document.getElementById(nameID) != "null" )
  32. {
  33. arrElement[nameID] = 1;
  34. }
  35.  
  36. return false;
  37. }


--------------------
Go to the top of the page
+Quote Post

Posty w temacie
- lenczewski   [ajax] input type=file   11.10.2006, 14:05:55
- - Skobi   ajaxem pliku nie wyslesz. A co do kodu to moj kod   11.10.2006, 18:57:01
- - NetJaro   Nie wyślesz? Google umie ;-)   12.10.2006, 13:18:03
- - jarrod   Cytat(lenczewski @ 11.10.2006, 15:05...   14.10.2006, 19:19:45


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 Aktualny czas: 20.08.2025 - 04:25