Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8133025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:29:16+00:00 2026-06-06T09:29:16+00:00

I want to create script to edit photos in galery. I have there textbox

  • 0

I want to create script to edit photos in galery. I have there textbox to insert title of photo and after insert title in it and leave textbox it’ll update in database.
It works ok, when I change title by only one photo, but when I change more titles and then I reload page, all changed photos have the same title (which was insert last).
Can somebody help me please what is wrong?

There is code which I using now:

function UpdateTitle(idPhoto) {
    var id = idPhoto;
    $(document).ready(function(){
        $('textarea').live('blur',function () {
            var titleVal = $(this).val();        

            $.ajax({
                 type: "POST",
                 url: "changeTitle.php",
                 data: {title:titleVal , id:id},
                 success: function(msg) {
                     $('.'+id).html(msg);
                 }
           })

       });
    });     
}

<textarea name='title' id='title' onchange='UpdateTitle($idPhoto);' rows='2' cols='22'>$title</textarea>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:29:21+00:00Added an answer on June 6, 2026 at 9:29 am

    More of a good programming tip rather than answering the question since it has already been answered but this would be cleaner:

    $('textarea').on('blur',function () {
        var titleVal = $(this).val(), id = $(this).data('id');        
    
        $.ajax({
             type: "POST",
             url: "changeTitle.php",
             data: {title:titleVal , id:id},
             success: function(msg) {
                 $('#'+id).html(msg);
             }
       })
    });
    

    With this HTML:

    <textarea name='title' id='title' data-id='$idPhoto' rows='2' cols='22'>$title</textarea>
    

    Will work much better and will be less confusing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sharepoint site and want to create a script for links with
I want to create super script for desired text selected by user. I found
I'm a student from indonesia and I want to create an script that deletes
JavaScript. I want to create simple script, that will be resize loaded image using
I want to create a powershell script that creates a shortcut in the windows
I want to create an SQL script that creates a database. Right now, I
I want to create a deployment script, somehow emulate Oracle deployment scripts, where with
I want to create an application in Apps Script that would fetch my Latitude
I want to create an HTTPURLConnection to a PHP script and get the HTTP
I want to create a simple bash script to launch a Java program on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.