Set the value of a textbox

Hello,

I have a text box MyTextBox. How can I programmatically set the value in
ASP?
An example please.

Thanks.
Dan Aldean [ Di, 30 Mai 2006 22:02 ] [ ID #1335165 ]

Re: Set the value of a textbox

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:

<input type="text" name="MyTextBox" value="
<%= "some value" %>">

--
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.
reb01501 [ Di, 30 Mai 2006 22:16 ] [ ID #1335166 ]

Re: Set the value of a textbox

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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
news:Oe$b2XChGHA.3924 [at] 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:
>
> <input type="text" name="MyTextBox" value="
> <%= "some value" %>">
>
> --
> 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.
>
>
Dan Aldean [ Di, 30 Mai 2006 23:08 ] [ ID #1335167 ]

Re: Set the value of a textbox

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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
> news:Oe$b2XChGHA.3924 [at] 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:
>>
>> <input type="text" name="MyTextBox" value="
>> <%= "some value" %>">
>>
>> --
>> 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"
reb01501 [ Di, 30 Mai 2006 23:41 ] [ ID #1335168 ]

Re: Set the value of a textbox

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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
news:uVRFPHDhGHA.4404 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>> news:Oe$b2XChGHA.3924 [at] 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:
>>>
>>> <input type="text" name="MyTextBox" value="
>>> <%= "some value" %>">
>>>
>>> --
>>> 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"
>
Dan Aldean [ Di, 30 Mai 2006 23:45 ] [ ID #1335169 ]

Re: Set the value of a textbox

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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
> news:uVRFPHDhGHA.4404 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>> news:Oe$b2XChGHA.3924 [at] 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:
>>>>
>>>> <input type="text" name="MyTextBox" value="
>>>> <%= "some value" %>">

--
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"
reb01501 [ Mi, 31 Mai 2006 00:02 ] [ ID #1335170 ]

Re: Set the value of a textbox

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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
news:OLrxzSDhGHA.4104 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>> news:uVRFPHDhGHA.4404 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>> news:Oe$b2XChGHA.3924 [at] 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:
>>>>>
>>>>> <input type="text" name="MyTextBox" value="
>>>>> <%= "some value" %>">
>
> --
> 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"
>
Dan Aldean [ Mi, 31 Mai 2006 00:08 ] [ ID #1335171 ]

Re: Set the value of a textbox

Or maybe it's not possible to change the original value of a control through
VBScript or JavaScript?

"Dan Aldean" <danaldean [at] yahoo.com> wrote in message
news:u2dIYWDhGHA.4656 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
> news:OLrxzSDhGHA.4104 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>> news:uVRFPHDhGHA.4404 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>>> news:Oe$b2XChGHA.3924 [at] 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:
>>>>>>
>>>>>> <input type="text" name="MyTextBox" value="
>>>>>> <%= "some value" %>">
>>
>> --
>> 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"
>>
>
>
Dan Aldean [ Mi, 31 Mai 2006 00:13 ] [ ID #1335172 ]

Re: Set the value of a textbox

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" <danaldean [at] yahoo.com> wrote in message
> news:u2dIYWDhGHA.4656 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>> news:OLrxzSDhGHA.4104 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>> news:uVRFPHDhGHA.4404 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>>>> news:Oe$b2XChGHA.3924 [at] 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:
>>>>>>>
>>>>>>> <input type="text" name="MyTextBox" value="
>>>>>>> <%= "some value" %>">
>>>
>>> --
>>> 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"
reb01501 [ Mi, 31 Mai 2006 00:20 ] [ ID #1335173 ]

Re: Set the value of a textbox

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" <danaldean [at] yahoo.com> wrote in message
>> news:u2dIYWDhGHA.4656 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>> news:OLrxzSDhGHA.4104 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>>> news:uVRFPHDhGHA.4404 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>>>>> news:Oe$b2XChGHA.3924 [at] 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:
>>>>>>>>
>>>>>>>> <input type="text" name="MyTextBox" value="
>>>>>>>> <%= "some value" %>">
>>>>
>>>> --
>>>> 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"
reb01501 [ Mi, 31 Mai 2006 00:28 ] [ ID #1335174 ]

Re: Set the value of a textbox

Thanks


"Bob Barrows [MVP]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
news:eI0QthDhGHA.1276 [at] 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" <danaldean [at] yahoo.com> wrote in message
>>> news:u2dIYWDhGHA.4656 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>> news:OLrxzSDhGHA.4104 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>>>> news:uVRFPHDhGHA.4404 [at] 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]" <reb01501 [at] NOyahoo.SPAMcom> wrote in message
>>>>>>>> news:Oe$b2XChGHA.3924 [at] 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:
>>>>>>>>>
>>>>>>>>> <input type="text" name="MyTextBox" value="
>>>>>>>>> <%= "some value" %>">
>>>>>
>>>>> --
>>>>> 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"
>
Dan Aldean [ Mi, 31 Mai 2006 00:35 ] [ ID #1335175 ]

Re: Set the value of a textbox

That's what I wanted:

<script type="text/javascript">
document.getElementById('txtBox').value="123456789"
</script>


"Dan Aldean" <danaldean [at] yahoo.com> wrote in message
news:OLLyvPChGHA.5104 [at] TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I have a text box MyTextBox. How can I programmatically set the value in
> ASP?
> An example please.
>
> Thanks.
>
Dan Aldean [ Mi, 31 Mai 2006 01:57 ] [ ID #1336894 ]

Re: Set the value of a textbox

are you talking about the initial value?? if so then

someVariable = database.field.item

<input type="text" name="someField" size="20" 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" <danaldean [at] yahoo.com> wrote in message
news:OLLyvPChGHA.5104 [at] TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I have a text box MyTextBox. How can I programmatically set the value in
> ASP?
> An example please.
>
> Thanks.
>
jeff [ Mi, 07 Juni 2006 23:21 ] [ ID #1346058 ]

Re: Set the value of a textbox

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
>
> <input type="text" name="someField" size="20"
> 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" <danaldean [at] yahoo.com> wrote in message
> news:OLLyvPChGHA.5104 [at] 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.
reb01501 [ Do, 08 Juni 2006 00:19 ] [ ID #1346061 ]
Webserver » microsoft.public.inetserver.asp.db » Set the value of a textbox

Vorheriges Thema: What are your thoughts on this???
Nächstes Thema: stumped on sql...