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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:26:02+00:00 2026-05-31T21:26:02+00:00

I have couple of issues- the first constraint on select is loaded when reference

  • 0

enter image description here

I have couple of issues-
the first constraint on select is loaded when reference table value selected.

ISSUE 1 – The last two select box name -Constraint on should have cloned option from first constraint on.but should not have the selected option in previous select box. How to do it?

ISSUE 2 – My select box is loaded on javascript call but i have to add a alert for this,why?
Code for population two select –

function LoadSelects()
{
 $("#columns2 option").each(function() {
        $(this).remove();
    });
 $("#columns3 option").each(function() {
        $(this).remove();
    });
   alert("i m called");  ///it does not load the selects if i remove this****why?
 $("#columns option").clone().appendTo("#columns2");
  $("#columns option").clone().appendTo("#columns3");
 }  
}

Controller code for population first select-

 def getColumns = {
    def columns = GGWSchemaXref.executeQuery("select distinct p.columnname     from GGWSchemaXref p where p.tablename=:table and p.dbname = 'IVR_GUARDIAN'",[table:params.tableCombo])
    render(template:"selectTemplate", model: [ columnList: columns ])

}

GSP page code here-

  <tr> <td>Reference Table:</td>
   <td><g:select name="tableCombo"
        noSelection="${['':message(code:'Select Table')]}"
        from="${result}" value="${tableName }"        onchange="${remoteFunction(action:'getColumns', update:'columns', params:'\'tableCombo=\'    + this.value', OnComplete = 'LoadSelects();')}"/> </td></tr>
 <tr id ="cons"><td nowrap>Constraint On:</td>
    <td nowrap><g:select name="columns" from="[]" /></td>
    <td nowrap>Constraint Value:</td>
    <td nowrap><g:textField name="columnValue" value="${enterVal }" />  
</tr>
 <tr id ="cons2"><td nowrap>Constraint On:</td>
    <td nowrap><g:select name="columns2" from="[]" /></td>
    <td nowrap>Constraint Value:</td>
    <td nowrap><g:textField name="columnValue2" value="${enterVal2 }" />  
</tr> 
 <tr id ="cons3"><td nowrap>Constraint On:</td>
    <td nowrap><g:select name="columns3" from="[]" /></td>
    <td nowrap>Constraint Value:</td>
    <td nowrap><g:textField name="columnValue3" value="${enterVal3 }" />  
</tr>     

ISSUE 3- I need to keep the selected and entered values after search (post back).

Please help how to do it?

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-31T21:26:03+00:00Added an answer on May 31, 2026 at 9:26 pm

    The first “A” in AJAX is for “asynchronous”. You need to execute LoadSelects() in the success callback of your ajax

    You can simplify the function to:

    function LoadSelects(){
    
        $("#columns2, #columns3").html( $("#columns").html()).val('') ;
    
     }
    

    This will copy the options from #columns to both of the other selects and unselect both which I believe is what you are asking.

    Using $('select').val('') as in code above will remove selected property from options

    Edit If the each you are using for your selects is due to have more than one with same ID you have a problem since ID’s must be unique. If this is the case, code will need to be refactored to a traverse within a row

    EDIT #2 AJAX Success

    jQuery.ajax({
        type: 'POST',
        data: 'tableCombo=' + this.value,
        url: '/GryphonMonitor/load/getColumns',
    
        success: function(data, textStatus) {‌
    
            /*  this is callback when all data has been received*/      
    
            jQuery('#columns').html(data);
             LoadSelects();
        },
        error: function(XMLHttpRequest, textStatus, ‌errorThrown) {}
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the last couple months i have ben having some issues with my app.config
I have a couple of things I'm working on, namely a page that issues
I am having an issue with ColdFusion's CFChart tag. I have a couple graphs
Ok so I've spent a couple hours trying to resolve this issue and have
I have a couple of views which use the SELECT CASE syntax.However when I
I have couple questions regarding some C++ rules. Why am I able to call
I have couple resource DLLs that I currently load when application starts using following
I have couple of questions about AS3 variables handling by AVM/compiler/scope .1. This code
I'll have couple of python functions I must interface with from the assembly code.
ok I have couple of .NET classes that I want to use in VBA.

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.