473,698 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms and hidden fields

Hi,

Are hidden fields passed in the querystring when a form is posted back?
If they are, must the hidden fields be server controls in order to
access them from .net code?

Thanks,
Roshawn
Nov 19 '05 #1
5 2141
No, they are passed in a form post which is different from a query string
(but has a similar effect)

AFAIK you can access them directly as Request["myHiddenFi eld"] or
Request.Form["myHiddenFi eld"]

but if you want to access them as server controls you can do that as well,
just declare them in the usual way:

<input type="hidden" runat="server" id="myHiddenFie ld" name="myHiddenF ield"
value="xyz">

I always make the ID and Name the same in this case - it's not strictly
necessary but a lot less confusing.

"Roshawn Dawson" <ud****@bellsou th.net> wrote in message
news:uZ******** *****@TK2MSFTNG P15.phx.gbl...
Hi,

Are hidden fields passed in the querystring when a form is posted back? If
they are, must the hidden fields be server controls in order to access
them from .net code?

Thanks,
Roshawn

Nov 19 '05 #2
Roshawn Dawson wrote:
Hi,

Are hidden fields passed in the querystring when a form is posted back?
If they are, must the hidden fields be server controls in order to
access them from .net code?

Thanks,
Roshawn


no..not in the QueryString but if the input is of type=hidden then yes
they are passed.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #3
Thanks guys for your prompt responses.

It seems that one of you says that hidden fields are not passed in the
querystring while the other says the opposite. Perhaps I wasn't clear
enough.

What I mean by hidden fields is hidden form fields. You know, the input
fields whose type is specified as hidden, like this:

<input type="hidden" name="227" id="227" value="stuff that is hidden" />

Are such fields included in the querystring or not?

Thanks,
Roshawn

Curt_C [MVP] wrote:
Roshawn Dawson wrote:
Hi,

Are hidden fields passed in the querystring when a form is posted
back? If they are, must the hidden fields be server controls in order
to access them from .net code?

Thanks,
Roshawn

no..not in the QueryString but if the input is of type=hidden then yes
they are passed.

Nov 19 '05 #4
Hi,

If you are using method="post" in your form element, the hidden fields will
be sent in the Request Collection when you submit the form.

If you are using the method="get", it will be sent in the query string

--
Saravanan K V
"Roshawn Dawson" wrote:
Thanks guys for your prompt responses.

It seems that one of you says that hidden fields are not passed in the
querystring while the other says the opposite. Perhaps I wasn't clear
enough.

What I mean by hidden fields is hidden form fields. You know, the input
fields whose type is specified as hidden, like this:

<input type="hidden" name="227" id="227" value="stuff that is hidden" />

Are such fields included in the querystring or not?

Thanks,
Roshawn

Curt_C [MVP] wrote:
Roshawn Dawson wrote:
Hi,

Are hidden fields passed in the querystring when a form is posted
back? If they are, must the hidden fields be server controls in order
to access them from .net code?

Thanks,
Roshawn

no..not in the QueryString but if the input is of type=hidden then yes
they are passed.

Nov 19 '05 #5
Thank you. Now I understand. :-)

Roshawn

Saravanan K V wrote:
Hi,

If you are using method="post" in your form element, the hidden fields will
be sent in the Request Collection when you submit the form.

If you are using the method="get", it will be sent in the query string

Nov 19 '05 #6

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

Similar topics

1
10077
by: petersk | last post by:
Firstly I am an older person trying to teach myself to create a project and teach myself Access VBA programming along the way. I anticipate a number of problems I will need help with but here goes with the first >From one form I want to open another form to extract data. I really want to do this with the form Hidden but initially show the form open so that I can easily check what is going on.
6
517
by: Manny Chohan | last post by:
I am using forms authetication in the web config. i can validate a user against a database and click on images which makes hidden panels visible.However when i click on the link inside a panel which should take user to another pages, it defaults them back to the login page prompting them to enter username and password. Could someone please shed some light on this on how i can fix this issue? Thanks Manny
1
1958
by: foothills bhc | last post by:
I have a problem with verifying content of controls on a form before closing the form or moving to the next form "record" (i.e., when moving to the next row of my form's record source). HERE'S THE LONG EXPLANATION OF THE PROBLEM First, A Description of the Form: I have developed a form for entering survey questionnaire data. The data to be entred on the form could be considered as two kinds of information. One kind could be called...
3
1364
by: Jerim79 | last post by:
I was handed a voting form that the company has used in previous years, for updating. The first page is a form, asking for name, business name, title and email address(twice for verification). The form gets posted to a verfication PHP script that checks that the email addresses match and that the email address isn't already in the database. If there is a problem, it sends you back to the first form; if everything is okay it sends you on to...
7
2788
by: thersitz | last post by:
I can't seem to get my html form to submit properly from within a web form. Here's my form tag syntax and some delivery hidden fields. <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi" method="POST" onsubmit="return verify();"> <input type="hidden" name="recipient" value=me@mymail.net /> <input type="hidden" name="redirect" value="http://www.xxx.org/forms/confirmation.htm" /> .......................
19
248204
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect this data is essential to any developer. This article is a basic tutorial on how to user HTML Forms, the most common method of data collection. Assumptions - Basic HTML knowledge. - Basic PHP knowledge. HTML Forms A common and simple way of...
2
1907
by: vajra1987 | last post by:
Hi guys I have the following situation: In mypage1.jsp I have 4 forms, each with a different name (and id). But on these forms, there are some fields that have the same name, for example mypage1.jsp: <form action="" name="form1" id="form1" method="POST" > <input type="hidden" name="myValFld" value=""/> .....
4
3505
by: minchazo | last post by:
Hello, I've been creating some forms recently in Access 2003 and using hidden textboxes quite a bit. As an example, the visible textbox CasesDone uses the DLookup function to sum the records in table Cases. The hidden textbox in the form (HiddenCasesDone) is bound to the Week_Data table and I set the value of that textbox with a form event. Is there a better way to do this? I seem to recall when taking my VB classes (way too long ago)...
6
1848
by: Graham | last post by:
I have long thought there is something missing with HTML forms, in that there should be a provision for a form with hidden input fields, with the whole form being hidden, in particular with no submit button that requires clicking. I have a form that, when processed by a Perl CGI script, sends back a 'Thankyou' message to the user, and I then want to tell the user that in a few seconds he will be taken to the next stage of the process,...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.