-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to update multiple dragged image that i have already saved with database #4 #25
Comments
I would aim for something more like this but I haven't tested it
|
i have got the solution but not the best one bye removing and again adding the class in ajax success |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello everyone am updating image dragged with database but problem is that when am updating one image all the image dragged got updating with same
thank you in advance here is my code please let me know if there any one know am trying to solve this from last 2 days but not able to do
thank you so much
**this is the image div for dragging **
<div class="preview">Images</div> <div class="view imageschange "> <img alt="140x140" width="100%" height="100%" id="uniqueid" src="img/Desert.jpg" data-toggle="modal" data-target="#exampleModal"> </div>
**this code is for all the image form the database **
<?php foreach ($result as $row) { ?> <td > <input type="checkbox" value="<?php echo $row['images_id']; ?>" id="<?php echo $row['images_id']; ?>" name="image_id" required > <?php Echo "<img width='100px;' height='100px;' src=img/".$row['images_path'] .">"; ?> </td> <?php } ?> <input type="submit" style="float: right;" onclick="checkFluency()" class="btn btn-primary" value="Insert" name="changedImage" id="changedImage" />
this line of code for selecting one image form the modal using checkbox onclick event
`function checkFluency(){
var img = document.getElementsByName('image_id');
var selectedimg="";
for(var i=0; i<img.length; i++){
if(img[i].type=='checkbox' && img[i].checked==true){
selectedimg+=img[i].value+"\n";
**and last this line of code for response of ajax that changes the image **
`if(isset($_POST['post_id'])){
$issueID = $_POST['post_id'];//echo $issueID; // echo the data
$sql = "SELECT images_id, images_path FROM images_tbl WHERE images_id= $issueID";
//echo $sql;
$result = mysqli_query($conn, $sql);?>
<img alt="140x140" width="100%" height="100%"
src="img/" id=""
data-toggle="modal" data-target="#exampleModal">
The text was updated successfully, but these errors were encountered: