Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ($i = 0; $i < 4; $i++) {
- <form id="TypeValidation" method="" enctype="multipart/form-data">
- <input type="hidden" id="pii_categoryid" name="pii_categoryid" value="<?php echo $i;?>" />
- <div>
- <span class="btn btn-rose btn-round btn-file">
- <span class="fileinput-new">Select File</span>
- <span class="fileinput-exists">Change</span>
- <input type="file" name="<?php echo $fileName;?>_attachment" id="<?php echo $fileName;?>_attachment" accept=".xlsx, .xls, .csv" />
- </span>
- <a href="#" class="btn btn-danger btn-round fileinput-exists" data-dismiss="fileinput"><i class="fa fa-times"></i> Remove</a>
- <button type="submit" name="add_file" id="add_file" value="<?php echo $fileName;?>_file" class="btn btn-success btn-round fileinput-exists">Upload</button>
- </div>
- </form>
- }
- $("#TypeValidation").on('submit',(function(e)
- {
- var pii_categoryid = $(this).find('input[name="pii_categoryid"]').val();
- var fileUploadID = $(this).find('button[name="add_file"]').val();
- e.preventDefault();
- $.ajax({
- url: "fn_dsr_wizard_submit.php?submitid="+fileUploadID,
- type: "POST",
- data: new FormData(this),
- contentType: false,
- cache: false,
- processData:false,
- dataType: "html",
- success: function (result) {
- alert(result);
- //prompt("Copy to clipboard: Ctrl+C, Enter", result);
- location.reload();
- if(result=='1'){
- location.replace("ds_dashboard.php");
- }else {
- location.replace("ds_dashboard.php");
- }
- }
- });
- }
- ));
Add Comment
Please, Sign In to add comment