Set the value of a textbox
am 30.05.2006 22:02:06 von Dan AldeanHello,
I have a text box MyTextBox. How can I programmatically set the value in
ASP?
An example please.
Thanks.
Hello,
I have a text box MyTextBox. How can I programmatically set the value in
ASP?
An example please.
Thanks.
Dan Aldean wrote:
> Hello,
>
> I have a text box MyTextBox. How can I programmatically set the value
> in ASP?
> An example please.
>
Response.write the value into its value attribute:
">
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Thanks Bob. But if I try later to change the value, which comes from a
database for example, how do I do it?
"Bob Barrows [MVP]"
news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
> Dan Aldean wrote:
>> Hello,
>>
>> I have a text box MyTextBox. How can I programmatically set the value
>> in ASP?
>> An example please.
>>
> Response.write the value into its value attribute:
>
> ">
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
Everything is done by writing to Response. I'm not really sure what you are
asking.
Dan Aldean wrote:
> Thanks Bob. But if I try later to change the value, which comes from a
> database for example, how do I do it?
>
>
> "Bob Barrows [MVP]"
> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>> Dan Aldean wrote:
>>> Hello,
>>>
>>> I have a text box MyTextBox. How can I programmatically set the
>>> value in ASP?
>>> An example please.
>>>
>> Response.write the value into its value attribute:
>>
>> ">
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
I need a sample of ASP code, VB or Java script to set the value of a textbox
once I return values from the database or perform a calculation for example.
"Bob Barrows [MVP]"
news:uVRFPHDhGHA.4404@TK2MSFTNGP05.phx.gbl...
> Everything is done by writing to Response. I'm not really sure what you
> are asking.
>
> Dan Aldean wrote:
>> Thanks Bob. But if I try later to change the value, which comes from a
>> database for example, how do I do it?
>>
>>
>> "Bob Barrows [MVP]"
>> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>>> Dan Aldean wrote:
>>>> Hello,
>>>>
>>>> I have a text box MyTextBox. How can I programmatically set the
>>>> value in ASP?
>>>> An example please.
>>>>
>>> Response.write the value into its value attribute:
>>>
>>> ">
>>>
>>> --
>>> Microsoft MVP -- ASP/ASP.NET
>>> Please reply to the newsgroup. The email account listed in my From
>>> header is my spam trap, so I don't check it very often. You will get
>>> a quicker response by posting to the newsgroup.
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
I would start by browsing through the messages in this newsgroup. Tons of
examples.
There are sites that provide tutorials as well.
http://www.w3schools.com/sql/default.asp
Dan Aldean wrote:
> I need a sample of ASP code, VB or Java script to set the value of a
> textbox once I return values from the database or perform a
> calculation for example.
> "Bob Barrows [MVP]"
> news:uVRFPHDhGHA.4404@TK2MSFTNGP05.phx.gbl...
>> Everything is done by writing to Response. I'm not really sure what
>> you are asking.
>>
>> Dan Aldean wrote:
>>> Thanks Bob. But if I try later to change the value, which comes
>>> from a database for example, how do I do it?
>>>
>>>
>>> "Bob Barrows [MVP]"
>>> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>>>> Dan Aldean wrote:
>>>>> Hello,
>>>>>
>>>>> I have a text box MyTextBox. How can I programmatically set the
>>>>> value in ASP?
>>>>> An example please.
>>>>>
>>>> Response.write the value into its value attribute:
>>>>
>>>> ">
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Sorry if I was not clear. I looked into different samples over the internet,
W3school included and I could not find what I am looking for. Forgetting
about SQL, I want to change the value of an existing textbox control with a
value, different from the original one, through ASP-VBScript or JScript.
"Bob Barrows [MVP]"
news:OLrxzSDhGHA.4104@TK2MSFTNGP04.phx.gbl...
>I would start by browsing through the messages in this newsgroup. Tons of
>examples.
> There are sites that provide tutorials as well.
> http://www.w3schools.com/sql/default.asp
>
> Dan Aldean wrote:
>> I need a sample of ASP code, VB or Java script to set the value of a
>> textbox once I return values from the database or perform a
>> calculation for example.
>> "Bob Barrows [MVP]"
>> news:uVRFPHDhGHA.4404@TK2MSFTNGP05.phx.gbl...
>>> Everything is done by writing to Response. I'm not really sure what
>>> you are asking.
>>>
>>> Dan Aldean wrote:
>>>> Thanks Bob. But if I try later to change the value, which comes
>>>> from a database for example, how do I do it?
>>>>
>>>>
>>>> "Bob Barrows [MVP]"
>>>> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>>>>> Dan Aldean wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I have a text box MyTextBox. How can I programmatically set the
>>>>>> value in ASP?
>>>>>> An example please.
>>>>>>
>>>>> Response.write the value into its value attribute:
>>>>>
>>>>> ">
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
Or maybe it's not possible to change the original value of a control through
VBScript or JavaScript?
"Dan Aldean"
news:u2dIYWDhGHA.4656@TK2MSFTNGP04.phx.gbl...
> Sorry if I was not clear. I looked into different samples over the
> internet, W3school included and I could not find what I am looking for.
> Forgetting about SQL, I want to change the value of an existing textbox
> control with a value, different from the original one, through
> ASP-VBScript or JScript.
>
>
> "Bob Barrows [MVP]"
> news:OLrxzSDhGHA.4104@TK2MSFTNGP04.phx.gbl...
>>I would start by browsing through the messages in this newsgroup. Tons of
>>examples.
>> There are sites that provide tutorials as well.
>> http://www.w3schools.com/sql/default.asp
>>
>> Dan Aldean wrote:
>>> I need a sample of ASP code, VB or Java script to set the value of a
>>> textbox once I return values from the database or perform a
>>> calculation for example.
>>> "Bob Barrows [MVP]"
>>> news:uVRFPHDhGHA.4404@TK2MSFTNGP05.phx.gbl...
>>>> Everything is done by writing to Response. I'm not really sure what
>>>> you are asking.
>>>>
>>>> Dan Aldean wrote:
>>>>> Thanks Bob. But if I try later to change the value, which comes
>>>>> from a database for example, how do I do it?
>>>>>
>>>>>
>>>>> "Bob Barrows [MVP]"
>>>>> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>>>>>> Dan Aldean wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> I have a text box MyTextBox. How can I programmatically set the
>>>>>>> value in ASP?
>>>>>>> An example please.
>>>>>>>
>>>>>> Response.write the value into its value attribute:
>>>>>>
>>>>>> ">
>>
>> --
>> Microsoft MVP - ASP/ASP.NET
>> Please reply to the newsgroup. This email account is my spam trap so I
>> don't check it very often. If you must reply off-line, then remove the
>> "NO SPAM"
>>
>
>
Do you mean doing it in the client-side code? If so, post your question to a
client-side newsgroup.
All ASP does is generate the html that is sent to the client. Once it's
loaded in the client's browser, ASP is out of the picture.
Dan Aldean wrote:
> Or maybe it's not possible to change the original value of a control
> through VBScript or JavaScript?
>
> "Dan Aldean"
> news:u2dIYWDhGHA.4656@TK2MSFTNGP04.phx.gbl...
>> Sorry if I was not clear. I looked into different samples over the
>> internet, W3school included and I could not find what I am looking
>> for. Forgetting about SQL, I want to change the value of an existing
>> textbox control with a value, different from the original one,
>> through ASP-VBScript or JScript.
>>
>>
>> "Bob Barrows [MVP]"
>> news:OLrxzSDhGHA.4104@TK2MSFTNGP04.phx.gbl...
>>> I would start by browsing through the messages in this newsgroup.
>>> Tons of examples.
>>> There are sites that provide tutorials as well.
>>> http://www.w3schools.com/sql/default.asp
>>>
>>> Dan Aldean wrote:
>>>> I need a sample of ASP code, VB or Java script to set the value of
>>>> a textbox once I return values from the database or perform a
>>>> calculation for example.
>>>> "Bob Barrows [MVP]"
>>>> news:uVRFPHDhGHA.4404@TK2MSFTNGP05.phx.gbl...
>>>>> Everything is done by writing to Response. I'm not really sure
>>>>> what you are asking.
>>>>>
>>>>> Dan Aldean wrote:
>>>>>> Thanks Bob. But if I try later to change the value, which comes
>>>>>> from a database for example, how do I do it?
>>>>>>
>>>>>>
>>>>>> "Bob Barrows [MVP]"
>>>>>> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>>>>>>> Dan Aldean wrote:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I have a text box MyTextBox. How can I programmatically set the
>>>>>>>> value in ASP?
>>>>>>>> An example please.
>>>>>>>>
>>>>>>> Response.write the value into its value attribute:
>>>>>>>
>>>>>>> ">
>>>
>>> --
>>> Microsoft MVP - ASP/ASP.NET
>>> Please reply to the newsgroup. This email account is my spam trap
>>> so I don't check it very often. If you must reply off-line, then
>>> remove the "NO SPAM"
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
My apologies. I forgot to supply the name of an appropriate group:
microsoft.public.scripting.jscript
microsoft.public.scripting.vbscript
Bob Barrows [MVP] wrote:
> Do you mean doing it in the client-side code? If so, post your
> question to a client-side newsgroup.
>
> All ASP does is generate the html that is sent to the client. Once
> it's loaded in the client's browser, ASP is out of the picture.
>
>
> Dan Aldean wrote:
>> Or maybe it's not possible to change the original value of a control
>> through VBScript or JavaScript?
>>
>> "Dan Aldean"
>> news:u2dIYWDhGHA.4656@TK2MSFTNGP04.phx.gbl...
>>> Sorry if I was not clear. I looked into different samples over the
>>> internet, W3school included and I could not find what I am looking
>>> for. Forgetting about SQL, I want to change the value of an existing
>>> textbox control with a value, different from the original one,
>>> through ASP-VBScript or JScript.
>>>
>>>
>>> "Bob Barrows [MVP]"
>>> news:OLrxzSDhGHA.4104@TK2MSFTNGP04.phx.gbl...
>>>> I would start by browsing through the messages in this newsgroup.
>>>> Tons of examples.
>>>> There are sites that provide tutorials as well.
>>>> http://www.w3schools.com/sql/default.asp
>>>>
>>>> Dan Aldean wrote:
>>>>> I need a sample of ASP code, VB or Java script to set the value of
>>>>> a textbox once I return values from the database or perform a
>>>>> calculation for example.
>>>>> "Bob Barrows [MVP]"
>>>>> news:uVRFPHDhGHA.4404@TK2MSFTNGP05.phx.gbl...
>>>>>> Everything is done by writing to Response. I'm not really sure
>>>>>> what you are asking.
>>>>>>
>>>>>> Dan Aldean wrote:
>>>>>>> Thanks Bob. But if I try later to change the value, which comes
>>>>>>> from a database for example, how do I do it?
>>>>>>>
>>>>>>>
>>>>>>> "Bob Barrows [MVP]"
>>>>>>> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>>>>>>>> Dan Aldean wrote:
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I have a text box MyTextBox. How can I programmatically set
>>>>>>>>> the value in ASP?
>>>>>>>>> An example please.
>>>>>>>>>
>>>>>>>> Response.write the value into its value attribute:
>>>>>>>>
>>>>>>>> ">
>>>>
>>>> --
>>>> Microsoft MVP - ASP/ASP.NET
>>>> Please reply to the newsgroup. This email account is my spam trap
>>>> so I don't check it very often. If you must reply off-line, then
>>>> remove the "NO SPAM"
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Thanks
"Bob Barrows [MVP]"
news:eI0QthDhGHA.1276@TK2MSFTNGP03.phx.gbl...
> My apologies. I forgot to supply the name of an appropriate group:
> microsoft.public.scripting.jscript
> microsoft.public.scripting.vbscript
>
> Bob Barrows [MVP] wrote:
>> Do you mean doing it in the client-side code? If so, post your
>> question to a client-side newsgroup.
>>
>> All ASP does is generate the html that is sent to the client. Once
>> it's loaded in the client's browser, ASP is out of the picture.
>>
>>
>> Dan Aldean wrote:
>>> Or maybe it's not possible to change the original value of a control
>>> through VBScript or JavaScript?
>>>
>>> "Dan Aldean"
>>> news:u2dIYWDhGHA.4656@TK2MSFTNGP04.phx.gbl...
>>>> Sorry if I was not clear. I looked into different samples over the
>>>> internet, W3school included and I could not find what I am looking
>>>> for. Forgetting about SQL, I want to change the value of an existing
>>>> textbox control with a value, different from the original one,
>>>> through ASP-VBScript or JScript.
>>>>
>>>>
>>>> "Bob Barrows [MVP]"
>>>> news:OLrxzSDhGHA.4104@TK2MSFTNGP04.phx.gbl...
>>>>> I would start by browsing through the messages in this newsgroup.
>>>>> Tons of examples.
>>>>> There are sites that provide tutorials as well.
>>>>> http://www.w3schools.com/sql/default.asp
>>>>>
>>>>> Dan Aldean wrote:
>>>>>> I need a sample of ASP code, VB or Java script to set the value of
>>>>>> a textbox once I return values from the database or perform a
>>>>>> calculation for example.
>>>>>> "Bob Barrows [MVP]"
>>>>>> news:uVRFPHDhGHA.4404@TK2MSFTNGP05.phx.gbl...
>>>>>>> Everything is done by writing to Response. I'm not really sure
>>>>>>> what you are asking.
>>>>>>>
>>>>>>> Dan Aldean wrote:
>>>>>>>> Thanks Bob. But if I try later to change the value, which comes
>>>>>>>> from a database for example, how do I do it?
>>>>>>>>
>>>>>>>>
>>>>>>>> "Bob Barrows [MVP]"
>>>>>>>> news:Oe$b2XChGHA.3924@TK2MSFTNGP03.phx.gbl...
>>>>>>>>> Dan Aldean wrote:
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> I have a text box MyTextBox. How can I programmatically set
>>>>>>>>>> the value in ASP?
>>>>>>>>>> An example please.
>>>>>>>>>>
>>>>>>>>> Response.write the value into its value attribute:
>>>>>>>>>
>>>>>>>>> ">
>>>>>
>>>>> --
>>>>> Microsoft MVP - ASP/ASP.NET
>>>>> Please reply to the newsgroup. This email account is my spam trap
>>>>> so I don't check it very often. If you must reply off-line, then
>>>>> remove the "NO SPAM"
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
That's what I wanted:
"Dan Aldean"
news:OLLyvPChGHA.5104@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I have a text box MyTextBox. How can I programmatically set the value in
> ASP?
> An example please.
>
> Thanks.
>
are you talking about the initial value?? if so then
someVariable = database.field.item
is this what you mean??
i am by no means a pro at this, but i think i read through what you were
trying to say
jeff
"Dan Aldean"
news:OLLyvPChGHA.5104@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I have a text box MyTextBox. How can I programmatically set the value in
> ASP?
> An example please.
>
> Thanks.
>
Welcome to the group.
Unless you really have some time to kill, you might want to make a point
of reading through all the replies in a thread before replying yourself.
if you had you would have realized that Dan got his answer a week ago.
Jeff wrote:
> are you talking about the initial value?? if so then
>
> someVariable = database.field.item
>
>
> value="<%=someVariable%>">
>
> is this what you mean??
> i am by no means a pro at this, but i think i read through what you
> were trying to say
> jeff
>
> "Dan Aldean"
> news:OLLyvPChGHA.5104@TK2MSFTNGP04.phx.gbl...
>> Hello,
>>
>> I have a text box MyTextBox. How can I programmatically set the
>> value in ASP?
>> An example please.
>>
>> Thanks.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.