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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:58:45+00:00 2026-05-24T21:58:45+00:00

I created a form with a dialog search box for a Street Address and

  • 0

I created a form with a dialog search box for a Street Address and one for a Postal address. How it works is when you click on the search result it populates either the Street or Postal address depending on which button you clicked. It’s all working fine, except when you click on a search result it clears the field population for the other address. As far as I can tell this is all linked to the click function. ANy help will be greatly appreciated, thanks

For example:
If I click on the Postal address button and click a search result it will populate the postal address fields. Then if I click the Street address button, it will populate the Street address fields but also clear the Postal address fields.

Code

<!-- STREET ADDRESS -->
<script type="text/javascript">
  $(document).ready(function() {
    $('#table-data tr').click(function () {
      var curRowClass = $(this).attr("class");
      $('#street_name').val( $('.' + curRowClass + ' td.address_street').text() );
      $('#suburb').val( $('.' + curRowClass + ' td.address_suburb').text() );
      $('#city').val( $('.' + curRowClass + ' td.address_city').text() );
      $("#modal_form").dialog('close');
    });
  });
</script>

<!-- POSTAL ADDRESS -->
<script type="text/javascript">
  $(document).ready(function() {
    $('#table-data tr').click(function () {
      var curRowClass = $(this).attr("class");
      $('#street_name_classy').val( $('.' + curRowClass + ' td.address_street_classy').text() );
      $('#suburb_classy').val( $('.' + curRowClass + ' td.address_suburb_classy').text() );
      $('#city_classy').val( $('.' + curRowClass + ' td.address_city_classy').text() );
      $("#modal_form").dialog('close');
    });
  });
</script>

I can post more code if you need but I’ve narrowed it down to his click function, in this script that is causing the issue.

Thanks

  • 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-24T21:58:47+00:00Added an answer on May 24, 2026 at 9:58 pm

    Thanks guys, I ended up solving it using

    $('#table-data tr').live('click',function ()
    

    cheers

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

Sidebar

Related Questions

Using jquery dialog I have created a popup box with a form. I am
I created a form application with 1 button and 1 text box to see
So I've created a form in Access, which has a combo box and a
I had originally created a windows form to be a dialog of my projects
I've created a pseudo dialog (form with FormBorderStyle property set to FixedDialog) that contains
Scenario: Using jquery form plugin . The form appears in a dialog, created with
I am trying to using a jquery.validate.unotrusive.js plugin to dynamically created form fields like:
I created a form in CodeIgniter framework that successfully uploads an image using the
I created a form with a label, textbox and a button. In the form
I created a form that overlays on top of another form in an alpha

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.