Using a field that is filled in by javascript in a code behind page.

U

UJ

I have a JavaScript that fills in a text box with a date/time. I then need
to access it my code behind code. If I make the input field runat=server, I
can get at it by code behind but JavaScript can't see it. If I don't have
the runat=server, then JavaScript can get at it but I can't get at it in the
code behind.

Can anybody tell me how to make this work correctly ?

Thanks.

Jeff.
 
G

Guest

You could just as easily use an <asp:textbox> control. you can access it on
the client side using javascript so long as you refer to it using it's
clientside ID which is stored in the TextBox.ClientID property.
 
U

UJ

Changing it over to a asp:textbox still doesn't work. I get an error that
object doesn't exist in the javascript code.

I'm using somebody else's javascript and don't know much about it so maybe
it's accessing the wrong way. How would I get the value in the javascript?
 
U

UJ

Never mind. Turns out it had nothing to do with the variable. It's farther
in the code. Thanks anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top