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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:01:20+00:00 2026-05-20T21:01:20+00:00

Ok. Here’s the background. I have an application that is supposed to accept checks.

  • 0

Ok. Here’s the background.

I have an application that is supposed to accept checks. The user has 2 radio buttons. The first radio button has a drop down list associated with it which contains the masked numbers of their previously used checking accounts.

The second radio button has three text boxes and an image of a check associated with it.

When a user hits this page, the three text boxes and the check image associated with the second radio button are disabled. Then, if the user decides he/she wants to use a new checking account, they can click the second radio button and that fires the Javascript that enables the three check boxes and the image of the check associated with that second radio button. If they click on the first radio button, it will re-disable the text boxes and hide the check image associated with the second radio button.

The problem happens when I do my server side validation. After validating all text fields, if there is a problem, I just fall out of the bottom of the code, the page posts back and the labels above the offending text fields show an error message.

One caveat: The Javascript that is supposed to fire on the OnClick event for the first radio button fires and the text fields for the second radio button are disabled. The user can click on the second radio button and the fields will enable, but this is very clunky.

Here’s the enable code where I am injecting the Javascript:

Private Sub JavascriptInject()
        Dim sEnableControls As String
        Dim sDisableControls As String

        'write out the enable controls script
        sEnableControls = "<script type=""text/javascript"">function EnableControls(){ "
        sEnableControls = sEnableControls & "document.getElementById('txtRoutingNumMult').disabled=false;"
        sEnableControls = sEnableControls & "document.getElementById('txtECheckNumMult').disabled=false;"
        sEnableControls = sEnableControls & "document.getElementById('txtECHeckNameMult').disabled=false;"
        sEnableControls = sEnableControls & "document.getElementById('imgCheckMult').style.display='';"
        sEnableControls = sEnableControls & " }</script>"

        'write out the disable controls script
        sDisableControls = "<script type=""text/javascript"">function DisableControls(){ "
        sDisableControls = sDisableControls & "document.getElementById('txtRoutingNumMult').disabled=true;"
        sDisableControls = sDisableControls & "document.getElementById('txtECheckNumMult').disabled=true;"
        sDisableControls = sDisableControls & "document.getElementById('txtECHeckNameMult').disabled=true;"
        sDisableControls = sDisableControls & "document.getElementById('imgCheckMult').style.display='none';"
        sDisableControls = sDisableControls & " }</script>"

        'inject it
        ClientScript.RegisterStartupScript(Me.GetType, "EnableControls", sEnableControls)
        ClientScript.RegisterStartupScript(Me.GetType, "DisableControls", sDisableControls)

        rbECheckNew.Attributes.Add("OnClick", "EnableControls()")
        rbECheckPrev.Attributes.Add("OnClick", "DisableControls()")

    End Sub

How can I re-enable the text boxes on a failed validation postback?

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

    You can call the following function on failed validation postback:

    ClientScript.RegisterStartupScript(Me.GetType, “EnableControlsStartup”, “EnableControls()”, true)

    Link for reference:

    http://msdn.microsoft.com/en-us/library/system.web.ui.page.registerstartupscript.aspx

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

Sidebar

Related Questions

Here is my code (Say we have a single button on the page that
Here is my problem...I have a page that loads a list of clients and
Here is an example: I have a file 1.js, which has some functions. I
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is a link to the page. The Home button is supposed to be
Here is what is supposed to happen: The moment the user chooses an option
Here's the flow that I am trying to achieve: 1) User uploads an audio
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
here , i am creating file server program .in this i have noticed that

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.