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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:11:13+00:00 2026-05-11T14:11:13+00:00

so I have a modal dialog i use with jQuery in my asp .net

  • 0

so I have a modal dialog i use with jQuery in my asp .net page. I am trying to set a textbox value using jquery. here is some sample code:

<div class='popup-template popup1'>     <div class='content'>            <input type='text' id='tbX' value='asdf' />       <input type='button' onclick='$('#tbX').val('TEST VALUE');' value='Input Test' />       <input type='button' onclick='alert($('#tbX').val());' value='Output Test' />    </div> </div> 
  • If I click ‘Output Test’ the alert shows ‘asdf’
  • Then I click ‘Input Test’ and the textbox value doesn’t change
  • I click ‘Output Test’ once again and the alert shows ‘TEST VALUE’
  • If I change the text in the textbox manually the alert still show ‘TEST VALUE’

I already have, in place, the code to move my dialog back within the form tag so this isn’t the issue.

If I move the inputs outside of the modal div then everything works fine.

Thanks for your help

-Russ

  • 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. 2026-05-11T14:11:14+00:00Added an answer on May 11, 2026 at 2:11 pm

    Try using Firefox with Firebug (‘view generated source’) and see if the modal dialog is recreating your DOM for you and renaming the inputs. This would mean that you are accessing the original, now hidden input from the click handler and the new input when typing. If so, you could change how you are getting the text box element to use something like:

    $(this).parent('div').find('input[type=text]:first').val(...) 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using asp.net mvc 3 jquery validate unobstructive javascript. I am trying to
I have a problem with Jquery UI modal dialogs. I have modal dialog (dialogA),
I have a modal dialog plugin written in jquery, that binds to the click
I have a jquery modal dialog that displays a partial view. The partial view
I have a page that opens a modal dialog. After the operations done on
I'm trying to add a jQuery UI modal dialog to show when a function
I have blinking text modal dialog box and slideshow with jquery. They working just
I am tryng to use this: http://jqueryui.com/demos/dialog/#modal-form I have: <script type=text/javascript> $(document).ready(function() { $(#dialog).dialog();
I have a JSf form, I am tryin' to use jQuery Ui dialog plugin
I have an ASP.NET 3.5 web site project. In it there exists a page

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.