get current text from text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jrs85
    New Member
    • Feb 2008
    • 11

    get current text from text box

    I'm just a beginner for vb.net 2003..

    How do i initialize the text from a textbox into variable??

    the textbox was input orginally from SQL, then user may change it then update back it to SQL.. but i'm lost how to take the TEXT form TEXTBOX to intialize with sql command..
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by jrs85
    PLS HELP ME :-)

    I'm just a beginner for vb.net 2003..

    How do i initialize the text from a textbox into variable??

    the textbox was input orginally from SQL, then user may change it then update back it to SQL.. but i'm lost how to take the TEXT form TEXTBOX to intialize with sql command..

    PLS HELP
    There should be a Text or Value property you can get that information from. Did you look into that yet?

    Comment

    • abev
      New Member
      • Jan 2008
      • 22

      #3
      Originally posted by jrs85
      PLS HELP ME :-)

      I'm just a beginner for vb.net 2003..

      How do i initialize the text from a textbox into variable??

      the textbox was input orginally from SQL, then user may change it then update back it to SQL.. but i'm lost how to take the TEXT form TEXTBOX to intialize with sql command..

      PLS HELP
      jrs So you load the page and the value is filled in the textbox? I understand you are lost but at which part? You want to write the textbox value back to the database?

      You need a button or some other way to commit the change. If it's a vb.net form the sysntaxt for the text box value is 'me.textbox1.te xt' where textbox1 = the name of your textbox.

      Comment

      • jrs85
        New Member
        • Feb 2008
        • 11

        #4
        Originally posted by RedSon
        There should be a Text or Value property you can get that information from. Did you look into that yet?
        tq for the reply...

        yup i know the basic one such..

        >>var1 = me.textbox1.tex t

        is that do you meant? it just return / collect the TEXT on textbox originally put in the first place when the page load.. i wantted the edited one by user.. tq

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Originally posted by jrs85
          tq for the reply...

          yup i know the basic one such..

          >>var1 = me.textbox1.tex t

          is that do you meant? it just collect the TEXT on textbox originally put in the first place when the page load.. i wantted the edited one by user.. tq
          Ok then there should be a text changed event or something that you can listen for. Have you read the documentation on MSDN for textboxes?

          Comment

          • jrs85
            New Member
            • Feb 2008
            • 11

            #6
            Originally posted by RedSon
            Ok then there should be a text changed event or something that you can listen for. Have you read the documentation on MSDN for textboxes?
            How to get the textbox value at the client side ?

            well the far that i know... text change event is not the same in form, that normally i do in VB form.. that will react in real-time of text box changes..

            i'm newbie in this vb.net-aspx.

            do you have any useful link that i could go to.. tq

            Comment

            • RedSon
              Recognized Expert Expert
              • Jan 2007
              • 4980

              #7
              Originally posted by jrs85
              well the far that i know... text change event is not the same in form, that normally i do in VB form.. that will react in real-time of text box changes..

              i'm newbie in this vb.net-aspx.

              do you have any useful link that i could go to.. tq
              Oh its web? Sorry, I'm only good with desktop applications.

              Comment

              • jrs85
                New Member
                • Feb 2008
                • 11

                #8
                Originally posted by RedSon
                Oh its web? Sorry, I'm only good with desktop applications.
                too bad..

                i just got this link >> http://www.syncfusion. com/FAQ/aspnet/WEB_c5c.aspx

                --------------------
                28.10 How to get the textbox value at the client side ?

                <script lang="javascrip t">
                function CheckFunction()
                {
                if (document.getEl ementById('<%=t extbox2.ClientI D%>').value == "")
                {
                alert("Please enter a value");
                return;
                }
                }
                </script>

                <asp:textbox id="textbox2" runat="Server"> </asp:textbox>
                <input type=button id="btn1" onclick="javasc ript:CheckFunct ion();" value="Click">
                ---------------------

                but still not understand...

                anyone.. pls help ;-|

                Comment

                • jrs85
                  New Member
                  • Feb 2008
                  • 11

                  #9
                  erm.. i still don't have the answer how to get the client-side textbox.. most of the sites / forum that i visit they suggests to change on the java / html script.. which i very unfamiliar with yet..

                  i have done to avoid such problem is..

                  i don't load the page with any text / data from database automatically into the textbox on page_load.. instead i let user to click a button to fill the textbox first manually...

                  then user may change it to anything in the text box..

                  then by click save / update button.. the data can be capture by variable for latest text that type by user while ago.

                  then take variable into SQL command in to database..


                  to me it's quite simple than to get into the java/html coding..

                  it is quite frustrating that vb.net 2003 in aspx scripting have A LOT OF object and handler limitation...

                  thanks to all replies...Red Son..abev..

                  Comment

                  • MMcCarthy
                    Recognized Expert MVP
                    • Aug 2006
                    • 14387

                    #10
                    jrs

                    The further this thread goes on the less clear your question is. If you are looking for someone to do your work for you then you are out of luck as that is against the rules of this forum even if someone was kind enough to try it.

                    If you have attempted to solve this problem yourself and not been able to then please post the code on what you have tried and the experts will try to help you. However, asking a general vague question that is unclear and posting code in a language you say you are not familiar with is not helpful.

                    The experts will be unable to help you further unless you; (a) Make your question a lot clearer and (b) show some attempt you have made to solve this problem yourself.

                    ADMIN

                    Comment

                    • abev
                      New Member
                      • Jan 2008
                      • 22

                      #11
                      Originally posted by jrs85
                      erm.. i still don't have the answer how to get the client-side textbox.. most of the sites / forum that i visit they suggests to change on the java / html script.. which i very unfamiliar with yet..

                      i have done to avoid such problem is..

                      i don't load the page with any text / data from database automatically into the textbox on page_load.. instead i let user to click a button to fill the textbox first manually...

                      then user may change it to anything in the text box..

                      then by click save / update button.. the data can be capture by variable for latest text that type by user while ago.

                      then take variable into SQL command in to database..


                      to me it's quite simple than to get into the java/html coding..

                      it is quite frustrating that vb.net 2003 in aspx scripting have A LOT OF object and handler limitation...

                      thanks to all replies...Red Son..abev..
                      I'll give it another shot.

                      Page loads.
                      User presses button to load textbox
                      User may optionally change text in textbox
                      If user changes text in text box user clicks a button to save changes.

                      Before I continue am I correct? vb.net may have limitations but this is not one of them.

                      Comment

                      • jrs85
                        New Member
                        • Feb 2008
                        • 11

                        #12
                        my question is how to get a changed 'latest" textbox that on interface of client-sideto variables to get into SQL command.
                        In other words, i try to update information that show in the textbox into SQL which changed by user at client-side....

                        then several replies came in, which doesn't reply to my problem.. but then in few hours later, i got the answer to avoid such problem.

                        which to put out button to call the data from SQL into textbox AFTER PAGE HAVE BEEN LOAD... which user able to change it.. then came save/update button to get the NEW INFORMATION ON TEXT BOX INTO SQL.

                        to "abev" question i do not check whether the text box was changed or not, because in just beginner, i didn't how to change the JAVA/HTML/ASPX coding to get the response form client-side, i just know how to manipulate the interface and handling variables and data ONLY thru vb coding. And i also have try to use the standard stand alone application(exe ) by put out command of ON TEXTBOX CHANGED, but it isn't working on vb.net/aspx(WEB BASE APPLICATION)

                        I'M BE OPEN TO ANY SUGGESTION TO IMPROVE MY SYSTEM.

                        i just need to post my solution and still open to any idea to improvement.
                        I believe there are many people out there are having this problem.
                        Last edited by kenobewan; Feb 15 '08, 01:08 PM. Reason: Edited by moderator

                        Comment

                        • kenobewan
                          Recognized Expert Specialist
                          • Dec 2006
                          • 4871

                          #13
                          Originally posted by jrs85
                          my question is how to get a changed 'latest" textbox that on interface of client-sideto variables to get into SQL command.
                          In other words, i try to update information that show in the textbox into SQL which changed by user at client-side....

                          then several replies came in, which doesn't reply to my problem.. but then in few hours later, i got the answer to avoid such problem.

                          which to put out button to call the data from SQL into textbox AFTER PAGE HAVE BEEN LOAD... which user able to change it.. then came save/update button to get the NEW INFORMATION ON TEXT BOX INTO SQL.

                          to "abev" question i do not check whether the text box was changed or not, because in just beginner, i didn't how to change the JAVA/HTML/ASPX coding to get the response form client-side, i just know how to manipulate the interface and handling variables and data ONLY thru vb coding. And i also have try to use the standard stand alone application(exe ) by put out command of ON TEXTBOX CHANGED, but it isn't working on vb.net/aspx(WEB BASE APPLICATION)

                          I'M BE OPEN TO ANY SUGGESTION TO IMPROVE MY SYSTEM.

                          i just need to post my solution and still open to any idea to improvement.
                          I believe there are many people out there are having this problem.
                          Your problem lies in the fact that asp.net is an advanced technology. The newbies here are expected to know the basics. Why we don't give you the answer is that we hope that you will learn more by trying it youself. This is why we term your post homework where the poster is just requesting the answer.

                          So please find a tutorial, book or course. I have removed unecessary comments from your post. Please follow the posting guidelines for your next post. Thanks.

                          MODERATOR

                          Comment

                          Working...