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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:49:02+00:00 2026-06-09T09:49:02+00:00

I am trying to select an input field’s value inside modal window. function title()

  • 0

I am trying to select an input field’s value inside modal window.

function title()
{
  $('a.title_filestock').click(function(e) {
    e.preventDefault();
    var data   = $(this).children('img').attr('rel');
    var active = $(this).next('a.filestock_preview');
    var value  = active.text();
    new VayesModal('<label for=Display Name"><input id="'+data+'" type="text" size="12" value="'+$.trim(value)+'" />', { modal: true, modalOpacity: '.5', title: 'Type File Display Name', titleClass: 'anim warning', buttons: [{id: 0, label: 'Save', val: 'Y', btnClass: 'btn-success'}, {id: 1, label: 'Cancel', val: 'N', btnClass: 'btn-danger'}], callback: function(val) { if(val == 'Y') { alert($('input[id="'+data+'"]').val()); active.text('new string');  } else return false; }});
  });
}

title();

“new string” should be $('input[id="'+data+'"]').val() but it returns undefined. I might make a mistake?

  • 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-09T09:49:04+00:00Added an answer on June 9, 2026 at 9:49 am

    problem is, that
    callback:function(val) {
    dont have access to local “data” variable (defined) from function title()
    try alert(data) and this will be also undefined.

    try what console.log($(this)) will returns, because this must be any parent object (probably some ModalWindow object) and maybe you can add “data” variable into this and load from in callback
    }

    I didnt found any existing VayesModal library on google, so I cant help you more.
    Try http://jqueryui.com/demos/dialog/#modal-form

    little hint:
    $(‘input[id=”‘+data+'”]’) equals to $(‘input#”‘+data)

    EDIT:
    Found it 🙂 Callback is called after modal window is removed, so input doesnt exists yet. Go to messi.js, method
    Messi.prototype.hide(after) { and move “”if (after) after.call(); “” to first line in this.messi.animate…function, before .remove() }
    BUT keep in mind, that you changed plugin source code.
    (VayesModal is Messi plugin. )

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

Sidebar

Related Questions

I'm trying to change the value of a text input field based on user
I'm trying to select a text field inside the tab, when the tab is
I am trying to change the input field value dynamically when the user pick
I am trying to select the input field that is added when pressing the
I'm trying to get the value in my input field to be put into
I am trying to get what all fields(input,select) are changed during keyup and change
I'm trying to select dynamic ids when a user types something into the input
I'm trying to filter a table from an alphabetical <select> input with jQuery. I
I am trying to get the first input field in a form that isn't
I'm trying to get the javascript below to automatically update the input field (centimeters)

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.