473,372 Members | 892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Set html field value

GM
You can Request.Querystring to get an html field value, how can you set the value from a webform?

thanks,

Nov 16 '05 #1
7 4895
GM,

There are two ways to do this. First, if the code is running on the
server side, then there most likely is an object that represents the field
which you can set the value on.

If you want to set the value on the client side, then you will have to
find the HTML element through Javascript, (through the all collection on the
document most likely).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"GM" <GM@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
You can Request.Querystring to get an html field value, how can you set the value from a webform?
thanks,

Nov 16 '05 #2

I really don't understand your question - but it seems like you're trying to
set values of textboxes, labels,etc from inside code. In that case, you
could write some code

TextBox1.Text = "Some string"

--
Sriram Krishnan
Microsoft Student Ambassador
http://www.dotnetjunkies.com/weblog/sriram
"GM" <GM@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
You can Request.Querystring to get an html field value, how can you set the value from a webform?
thanks,

Nov 16 '05 #3
Hi,

You question is not very clear, are you trying to set an "initial" value
on a webform control?
if so all you have to do is set the correct property in the code behind:
theTextbox.Text = "This text will appear in the page";

If this is not what you want, give more details about it.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"GM" <GM@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
You can Request.Querystring to get an html field value, how can you set the value from a webform?
thanks,

Nov 16 '05 #4
Hi,

use it like this:
<INPUT type="hidden" runat="server" id="DueDateHDN" NAME="DueDateHDN">

the runat="server" does the magic
also in the page you have to declare it like this:
protected System.Web.UI.HtmlControls.HtmlInputHidden DueDateHDN;
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"GM" <GM@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
I was talking about html controls found on the html tab like textArea and Textfield. How can these fields be accessed on the server when placed on a
Webform?
thanks,
"GM" wrote:
You can Request.Querystring to get an html field value, how can you set the value from a webform?
thanks,

Nov 16 '05 #5
GM
but how do you access the information in the input field in the C# code on the server?
You cannot use fieldname.text to get to it...

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

use it like this:
<INPUT type="hidden" runat="server" id="DueDateHDN" NAME="DueDateHDN">

the runat="server" does the magic
also in the page you have to declare it like this:
protected System.Web.UI.HtmlControls.HtmlInputHidden DueDateHDN;
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"GM" <GM@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
I was talking about html controls found on the html tab like textArea and

Textfield. How can these fields be accessed on the server when placed on a
Webform?

thanks,
"GM" wrote:
You can Request.Querystring to get an html field value, how can you set the value from a webform?
thanks,


Nov 16 '05 #6
GM
But how can you set the field value on the server? you cannot use fieldname.text = "something";

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

use it like this:
<INPUT type="hidden" runat="server" id="DueDateHDN" NAME="DueDateHDN">

the runat="server" does the magic
also in the page you have to declare it like this:
protected System.Web.UI.HtmlControls.HtmlInputHidden DueDateHDN;
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"GM" <GM@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
I was talking about html controls found on the html tab like textArea and

Textfield. How can these fields be accessed on the server when placed on a
Webform?

thanks,
"GM" wrote:
You can Request.Querystring to get an html field value, how can you set the value from a webform?
thanks,


Nov 16 '05 #7
why not?

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"GM" <GM@discussions.microsoft.com> wrote in message
news:6F**********************************@microsof t.com...
But how can you set the field value on the server? you cannot use fieldname.text = "something";


"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

use it like this:
<INPUT type="hidden" runat="server" id="DueDateHDN" NAME="DueDateHDN">

the runat="server" does the magic
also in the page you have to declare it like this:
protected System.Web.UI.HtmlControls.HtmlInputHidden DueDateHDN;
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"GM" <GM@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
I was talking about html controls found on the html tab like textArea
and Textfield. How can these fields be accessed on the server when placed on a Webform?

thanks,
"GM" wrote:

> You can Request.Querystring to get an html field value, how can you
set the value from a webform?
>
> thanks,
>


Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: JDS | last post by:
Hi, all. I'd like to do the following, preferably *without* resorting to JavaScript: I have a long, dynamically-generated form questionnaire. Not all of the form fields are dynamically...
7
by: Gary | last post by:
I haver a table of students - Say 100 students that I need to be able to update/delete and amend. I know I can do this one student at a time which is simple but lets say I want to see all the...
4
by: Andrew Williams | last post by:
Does anyone know of a way to quickly validate an HTML web form? I need to make sure that certain fields on my form actually contain data and are not submitted blank. I have tried using...
2
by: Bhavin G | last post by:
Hi there , I am pretty new at javascripting and i am having this huge problem. I am using asp.net and C# webapplication. In my asp.net aspx file I have a place holder for taking an html table...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: Kevin Lyons | last post by:
Hello, I am trying to get all of my form elements passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html to the following URL:...
3
by: hugo | last post by:
Hi, I have a function that I call from form fields using the OnKeyUp function to replace special caracters. Once this function has been called, it does not set the focus on the form field where...
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
5
by: Muffinthief | last post by:
Hi guys, what I'm trying to do is very simple. Just make a simple check/uncheck button for some checkboxes. Here's what I have. <script language="JavaScript"> function checkAll(field) { for...
10
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.