I want to add Description: into form upload. How do add record into database<script id="template-upload" type="text/x-tmpl"><!-- The template to display files available for upload -->
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td class="preview"><span class="fade"></span></td>
<td class="name"><span>{%=file.name%}</span></td>
<td><input type="text" name="des" size="10" />
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else if (o.files.valid && !i) { %}
<td>
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
</td>
<td class="start">{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary">
<i class="icon-upload icon-white"></i>
<span>{%=locale.fileupload.start%}</span>
</button>
{% } %}</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">{% if (!i) { %}
<button class="btn btn-warning">
<i class="icon-ban-circle icon-white"></i>
<span>{%=locale.fileupload.cancel%}</span>
</button>
{% } %}</td>
</tr>
{% } %}
</script>
--
You received this message because you are subscribed to the Google Groups "jQuery-File-Upload" group.
To post to this group, send email to jquery-f...@googlegroups.com.
To unsubscribe from this group, send email to jquery-fileupl...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
$('#fileupload').bind('fileuploadsubmit', function (e, data) {
var inputs = data.context.find(':input');
if (inputs.filter('[required][value=""]').first().focus().length) {
return false;
}
data.formData = inputs.serializeArray();
});
<form id="fileupload" action="../server/add-project/" method="POST" enctype="multipart/form-data">
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<input type="hidden" name="pid" value="<?php echo $pid; ?>">
<div class="row fileupload-buttonbar">
<div class="span7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
<span>Start upload</span>
</button>
<!--<button type="reset" class="btn btn-warning cancel"> -->
<button type="reset" class="btn cancel">
<i class="icon-ban-circle icon-white"></i>
<span>Cancel upload</span>
</button>
</div>
</div>
<!-- The loading indicator is shown during file processing -->
<div class="fileupload-loading"></div>
<br>
<!-- The table listing the files available for upload/download -->
<table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
</form>$pid = $_POST['pid'];
$file->upload_to_db = $this->add_img($file->name, $pid);function add_img($filename, $pid)
{
$add_to_db = $this->query("INSERT INTO project_links (name, project_id) VALUES ('".$filename.", ".$pid."')") or die(mysql_error());
return $add_to_db;
} function add_img($filename, $pid)
{
$add_to_db = $this->query("INSERT INTO project_links (name) VALUES ('".$filename.", ".$pid."')") or die(mysql_error());
return $add_to_db;
} function add_img($filename, $pid)
{
$add_to_db = $this->query("INSERT INTO project_links (name, project_id) VALUES ('".$filename.", ".$pid."')") or die(mysql_error());
return $add_to_db;
} <td class="name" ><label>Caption: <input type="text" name="caption"></label></td>