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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:33:37+00:00 2026-06-06T14:33:37+00:00

So I’ve been struggling with this for a couple days now. I have a

  • 0

So I’ve been struggling with this for a couple days now. I have a login page, that checks if the user is logging in for the first time, and if so, it shows a jqueryui Dialog box asking the user to pick their security questions. The Dialog is simple, three dropdowns, three text boxes, and a continue and cancel button. The dialog is displaying find, and when you click continue, the data is saved to the database, but it only saves the default values of the dropdownlists, and it doesnt save the text from the text boxes. It seems to me like the form is posting back before the data saves, and then saves the blank/default content. I’ve tried everything I can find on the internet to fix this. As of right now, I’m launching the dialog box on page load for testing purposes. Code Below:

Javascript:

function validateQuestions() {

            var q1Index = $('#<%= ddlQuest1.ClientID%>').get(0).selectedIndex;
            var q2Index = $('#<%= ddlQuest2.ClientID%>').get(0).selectedIndex;
            var q3Index = $('#<%= ddlQuest3.ClientID%>').get(0).selectedIndex;
            "<%=Q3Index%>" = q3Index;
            var label = document.getElementById('<%= _lblQuestError.ClientID%>');
            label.style.display = 'none';

            if (q1Index == q2Index || q1Index == q3Index || q2Index == q3Index) {label.style.display = 'block';}
            else {label.style.display = 'none'}
            return false;
        }

        function validateAnswers() {

            var ans1Text = $('#<%= txtAnswer1.ClientID%>').val();
            var ans2Text = $('#<%= txtAnswer2.ClientID%>').val();
            var ans3Text = $('#<%= txtAnswer3.ClientID%>').val();
            var ans1error = document.getElementById('<%= _lblAns1Error.ClientID%>');
            var ans2error = document.getElementById('<%= _lblAns2Error.ClientID%>');
            var ans3error = document.getElementById('<%= _lblAns3Error.ClientID%>');
            ans1error.style.display = 'none';
            ans2error.style.display = 'none';
            ans3error.style.display = 'none';

            if(ans1Text=""){ans1error.style.display = 'block';}                
            else if(ans2Text=""){ans2error.style.display = 'block';}
            else if(ans3Text=""){ans3error.style.display = 'block';}
            else { ans1error.style.display = 'none'; ans2error.style.display = 'none'; ans3error.style.display = 'none'}

            return false;
        }
function cancel() {
            $("#_dlgQuest").dialog('close');
            return false;
        }
function showDialog() {
            var secQuestDlg = $('#_dlgQuest').dialog({
                bgiframe: true,
                height: 350,
                width: 900,
                modal: true,
                overlay: {
                    backgroundColor: '#000',
                    opacity: ".8"
                }
            });
            secQuestDlg.parent().appendTo('/html/body/form[0]');
        }

Button aspx: <asp:Button ID="_dlgbtnContinue" ToolTip="Continue" runat="server" Text="Continue"
UseSubmitBehavior="false" OnClick="_dlgbtnContinue_Click" CausesValidation="false" />

PageLoad:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ddlQuest3.Attributes.Add("onchange", "javascript:validateQuestions();");
            ddlQuest1.Attributes.Add("onchange", "javascript:validateQuestions();");
            ddlQuest2.Attributes.Add("onchange", "javascript:validateQuestions();");
            txtAnswer1.Attributes.Add("onblur", "javascript:validateAnswers();");
            txtAnswer2.Attributes.Add("onblur", "javascript:validateAnswers();");
            txtAnswer3.Attributes.Add("onblur", "javascript:validateAnswers();");  
            List<String> lstQuestions = QuikDrawServiceHelper._QuikDrawClient.GetQuestions();               
            ddlCountry.Focus();
            FillQuestions();
            ClientScript.RegisterStartupScript(GetType(), "hwa", "showDialog()", true);
            }
    }

Fillquestions:

try
            {
                foreach (string s in lstQuestions)
                {
                    if (s.Equals(Customer.Quest1Code))
                    {
                        q1 = s;
                    }
                    if (s.Equals(Customer.Quest2Code))
                    {
                        q2 = s;
                    }
                    if (s.Equals(Customer.Quest3Code))
                    {
                        q3 = s;
                    }
                }
            }
            catch (Exception ex)
            {

            }

Complete Click Event:

protected void _dlgbtnContinue_Click(object sender, EventArgs e)
        {  
            Customer = CompanyServiceHelper._CompanyClient.GetCustomerByID(Convert.ToInt32(Session["CustomerID"].ToString()));   
            if (Session["FirstLogin"] == "Yes")
            {
                Customer.Quest1Code = ddlQuest1.SelectedValue;
                Customer.Quest1Ans = txtAnswer1.Text;
                Customer.Quest2Code = ddlQuest2.SelectedValue;
                Customer.Quest2Ans = txtAnswer2.Text;
                Customer.Quest3Code = ddlQuest3.SelectedValue;
                Customer.Quest3Ans = txtAnswer3.Text;
                CompanyServiceHelper._CompanyClient.AddQuestionsForCustomer(Customer);
                Session["FirstLogin"] = "Yes";
                Session["CustID"] = Customer.CustID;                
    }

I’ve tried linkbuttons as well, and i get the same thing. Any help would be greatly appreciated.

  • 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-06T14:33:39+00:00Added an answer on June 6, 2026 at 2:33 pm

    Seems like when you click the dlgbtnContinue button it is still not doing a postback, therefore you get the !isPostBack all over, and then resets the values. After this, the _dlgbtnContinue_Click event is getting triggered, saving the blank values. Maybe try to check in !isPostBack if also the values in the DropDown are not the default, meaning that if they are not the default values you do not want to get inside that if again. Just an idea… It would be good to have the _dlgbtnContinue_Click code. Good luck.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.