Jump to content
php.lv forumi

javascript pieģenerē automātiski skaitli pēc kārtas


sandrulis

Recommended Posts

Sveiki,

šoreiz problēma ar javascript:

 

$(function(){
var btnUpload=$('#upload');
var status=$('#status');
new AjaxUpload(btnUpload, {
 action: 'upload-file.php',
 name: 'uploadfile',
 onSubmit: function(file, ext){
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
status.text('Ir atļauti tikai JPG, PNG vai GIF attēlu formāti.');
return false;
  }
  status.text('Augšuplādē ...');
 },
 onComplete: function(file, response){
  status.text('');
  if(response==="success"){
$('<li></li>').appendTo('#files').html('<img src="./uploads/'+file+'">'+file+'<textarea name='attela_apraksts'></textarea><div id="clear"></div>').addClass('success');
  } else{
$('<li></li>').appendTo('#files').text(file).addClass('error');
  }
 }
});

});

 

izmantojot ajax augšuplādes skriptu man vajag lai javascript pie textarea name='attela_apraksts' piemet klāt skaitli pēc kārtas piemēram pirmajai bildei name='attela_apraksts_1', otrajai name='attela_apraksts_2' u.t.t.

 

izmēģinaju ar i, bet tas negāja cauri, varbūt kāds var kaut ko ieteikt?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...