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

  • Home
  • SEARCH
  • 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 7717925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:01:51+00:00 2026-06-01T03:01:51+00:00

I have web form with a panel which has form elements in side it.

  • 0

I have web form with a panel which has form elements in side it. and i have two radio button also based on the selection of radio button i want to change the DefaultButton property of panel1 control to another like “btnASWebPages” based on which radio button is selected.

How i can change this property using jQuery. I have tried few option but didn’t seem to work.

<asp:Panel ID="Panel1" runat="server" DefaultButton="btnASArchive">
    <div id="AdvancedSearchBox" class="AdvancedSearchBox">
        <asp:Label ID="lblAdvancedSearch" CssClass="lblAdvancedSearch" runat="server" Text="SEARCH"></asp:Label>
        <asp:TextBox ID="txtAdvancedSearch" CssClass="txtAdvancedSearch" runat="server"></asp:TextBox>
    </div>
    <div id="AdvanceSearchChoice" class="AdvanceSearchChoice">
        <asp:RadioButton ID="rbSearchArchive" CssClass="rbSearchChoice" runat="server" Text="Articles Archive" GroupName="rdAdvanceSearchChoice" Checked="True" />
        <asp:RadioButton ID="rbSearchPages" CssClass="rbSearchChoice" runat="server" Text="Web Pages" GroupName="rdAdvanceSearchChoice" />
    </div>
</panel>

I have posted only related code for this issue as form is quite big to put all the code. Just to add more based on radiobutton selection i hide and unhide two different forms so that user can search in related area, But i have a problem where my client wants to activate search on enter key. in order to achive this i have to activate the default form related to radio button selection. For example if one select Archive option then archive form will be visible and vice versa.

  • 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-01T03:01:52+00:00Added an answer on June 1, 2026 at 3:01 am

    When rendered in the browser, this…

    <asp:Panel ID="pnlTest" runat="server" DefaultButton="btnTestButton"></asp:Panel>
    

    become this….

    <div id="ctl00_MainContent_pnlTest" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_MainContent_btnTestButton')"></div>
    

    You need to unbind the keypress event and create a new one. I think you’re going about this the wrong way and that it should be done on the server in postback events of the radio controls.

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

Sidebar

Related Questions

I have a web form that has 2 radio buttons, depending on which one
I have a simple web form which has a couple list boxes and a
I have a web form that has multiple ListBoxes, TextBoxes, DropDowns. If I put
I have a web form where I have a textbox in which the user
I have a Panel on a Windows Form. The Panel has autoscroll enabled. The
I have a simple form (textbox, submit button) which is wrapped in an update
I am running a thread in C#. I have web form. I declared public
I have a web form that binds a DataGrid to a, normally, different data
I have a web form that I am attempting to implement dynamic drop down
I have a web form that collects information and submits it to a cgi

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.