Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Loader
thc
post 22.05.2013, 16:13:19
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 29.03.2013

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


Witam,
chcę zrobić coś takiego, żeby po kliknięciu 'dodaj ogłoszenie" (gdy trzeba chwile zaczekać, aż się doda) osoba dodająca widziała co się dzieje, że musi chwilę zaczekać, czyli żeby wyświetlił jej się jakiś .gif loader.. przypuszczam, że ten urywek kodu za to odpowiada

Cytat
  1. <button class="button2" type="button" id="submit_b" onclick="submit_checkt();"><?php echo JText::_('Dodaj ogłoszenie'); ?></button>
  2. <input type="hidden" name="option" value="<?php echo $option;?>" />
  3.  
  4. <?php
  5. if(JRequest::getVar('id', 0, '', 'int' )>0){
  6. echo '<input type="hidden" name="view" value="saveEditItem" />';
  7. echo '<input type="hidden" name="id" value="'.$this->nl->id.'" />';
  8. echo '<input type="hidden" name="cat_id" value="'.$this->nl->cat_id.'" />';
  9. }else{
  10. echo '<input type="hidden" name="view" value="saveItem" />';
  11. }
  12. ?>
  13. <input type="hidden" name="boxchecked" value="0" />
  14. </form>
  15. </div>
  16. </div>
  17. <script type="text/javascript">
  18.  
  19. function addImage(imglimit){
  20.  
  21. lim=document.djForm['image[]'].length;
  22. if(!lim){
  23. lim=1;
  24. }
  25.  
  26. if(document.djForm['usun[]']){
  27. lim_old=document.djForm['usun[]'].length;
  28. if(!lim_old){
  29. lim_old=1;
  30. }
  31. lim = lim + lim_old;
  32. }
  33.  
  34.  
  35. if(lim==imglimit){
  36. alert('<?php echo JText::_('Maximum number of images is');?> '+imglimit);
  37. }else{
  38. var inputdiv = document.createElement('input');
  39. inputdiv.setAttribute('name','image[]');
  40. inputdiv.setAttribute('type','file');
  41.  
  42. var ni = $('uploader');
  43.  
  44. ni.appendChild(document.createElement('br'))
  45. ni.appendChild(inputdiv);
  46. }
  47.  
  48. }
  49.  
  50. function submit_checkt(){
  51.  
  52. if(document.getElementById("name").value==''){
  53. alert("<?php echo JText::_('Please enter title');?>");
  54. }else if(document.getElementById("cat_id").value=='0'){
  55. alert("<?php echo JText::_('Please select category');?>");
  56. }else if(document.getElementById("intro_desc").value=='' ){
  57. alert("<?php echo JText::_('Please enter description intro');?>");
  58. }else if(document.getElementById("description").value==' '){
  59. alert("<?php echo JText::_('Please enter description');?>");
  60. }else if(document.getElementById("contact").value==''){
  61. alert("<?php echo Jtext::_('Please enter contact');?>");
  62. }else{
  63. document.djForm.submit();
  64. }
  65.  
  66.  
  67. function checkt(){
  68. if(document.djForm.name.value.length<=40)
  69. {
  70. a=document.djForm.name.value.length;
  71. b=40;
  72. c=b-a;
  73. document.getElementById('ile').innerHTML= ''+c+'';
  74. }
  75. else
  76. {
  77. document.djForm.name.value = document.djForm.name.value.substring (0, 40);
  78. }
  79. }
  80. checkt();
  81.  
  82. </script>


ale nie wiem jaką komendę muszę wpisać, żeby zadziałało. Jest to urywek kodu DJClassifieds. Proszę o pomoc.
Adres strony gdyby był potrzebny i-olesnica.pl
Go to the top of the page
+Quote Post

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: 28.04.2024 - 19:19