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 1102685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:13:28+00:00 2026-05-17T01:13:28+00:00

when my ajaxupload script finishes it adds a read-only input w/ the value of

  • 0

when my ajaxupload script finishes it adds a read-only input w/ the value of the image’s URL.

it is a long script, but i think this is the relevant part that fires on successful completion:

var location = '<div id="'+ID+'_location" class="img_location">' + '<input name="'+ID+'" class="location regular-text" type="text" size="50" readonly="readonly" value="'+response+'" />';

$(container).append(location).show(); //create readonly input

$(container) is defined just as the parent div of the upload button. that part seems to work… the image is uploaded, it is saved properly, and the input w/ the image’s location is added to to the DOM. but i’ve discovered a bug that if I click my SAVE button (which triggers my ajax save function) then this new input is NOT captured.

here is my save function:

  $('form#childoptions').live('submit', function(e) {

      e.preventDefault();

      var values = $(this).serialize();
      alert(values);


      var data = {
        action: 'save_function',
        type : 'save',
        _nonce: '<?php echo $nonce; ?>',
        formdata: values
    };
      $.post(ajaxurl, data, function(response) {
            //alert(response);
         if(response == 1) {
              show_message(1);
              t = setTimeout('fade_message()', 2000);
          } else {
              show_message(99);
              t = setTimeout('fade_message()', 2000);
          }
      });

      //return false;
  }); 

only the new input is not captured. the rest works properly. there is also no problem if i refresh in between as I presume the input is part of the DOM. which is why i thought to use .live. i thought i had solved the issue twice- 1. i wasn’t using a “name” on the dynamic input and 2. i wasn’t using .live on the form. but now i am doing both and not getting anywhere.

all help is much appreciated. let me know if there is more information I can provide.

  • 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-05-17T01:13:29+00:00Added an answer on May 17, 2026 at 1:13 am

    It appears that your using live on the whole form, not on inputs. So the live event binding would try to pickup new forms with id childoptions. This won’t work. You’d be better off using bind() instead. Have you tried:

    $('form#childoptions').bind('submit', function(e) {…}
    

    I’m curious if this will fix your issue.

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

Sidebar

Related Questions

No related questions found

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.