Forum Moderators: open

Message Too Old, No Replies

I need help to get a value from a control

I want to get the value from the client and from the server.

         

beto_x

5:07 pm on Apr 19, 2004 (gmt 0)

10+ Year Member



I want a textbox that modifies its value with two buttons to increase or decrease the value. I want that this action runs in the client, but the final value of the textbox I need it in the server.

If I put a normal INPUT, i cannot access it from the server, but if I put a server control (with asp.net) I cannont access with a script that runs in the client.

Thanx.

TheNige

7:49 pm on Apr 19, 2004 (gmt 0)

10+ Year Member



sure you can. You can do either.

1) use regular input and use jscript to modify the value on the client side. Then you can access the value on the server side using Request.Form("inputname") or you can put runat=server on the html control and declare it on the codebehind or script section as server.web.ui.htmlcontrols.htmlinput and you can get the value that way.

2) use and asp:textbox and you can still manipulte it with jscript. If it is in a user control be sure to view the source when it renders to get the correct name/id that asp.net generates.

beto_x

11:25 pm on Apr 20, 2004 (gmt 0)

10+ Year Member



Thanx for your help, but i'm confused and I need your guide. I have these two controls:

<INPUT id="bptext" style="WIDTH: 60px; HEIGHT: 24px" type="text" size="3" runat="server">
<INPUT id="bpmas" style="WIDTH: 20px; HEIGHT: 24px" type="button" value="+" onclick="incrementa()">

I want to increase bptext value with bpmas, using the function increase, but I cannot access bptext...what's happening?

My script begins as follows:

<script language="javascript">
function increase()
{
}
</script>

I'm learning and I need your guide, please....

Thanx.

beto_x

10:56 pm on Apr 21, 2004 (gmt 0)

10+ Year Member



Thanx for your help....Now I can do it....

You gave me the clues....thanx...