473,398 Members | 2,120 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,398 software developers and data experts.

Hidden Text boxes

Due to the lack of persistence in a listbox element across postbacks I
have been forced to use textboxes to gather eg removed items (removed
via a javascript) so that the listbox can be repopulated on postback
amongst other things.

I now find (stupidly I didnt test this before) that when an asp text
box is invisible ie visible= false the client side sript that writes
to it shows an error- ie cant write to it. I have tried adding an
attribute ie textbox.Attributes.add of type hidden but to no avail.

Any clues?

Dan

Mar 14 '07 #1
4 1805
Hi,
You can use hidden html input instead
<input type="hidden" id="hdnInput" runat="server" />

Regards,
Mohamed Mosalem
http://mosalem.blogspot.com

"DanWeaver" wrote:
Due to the lack of persistence in a listbox element across postbacks I
have been forced to use textboxes to gather eg removed items (removed
via a javascript) so that the listbox can be repopulated on postback
amongst other things.

I now find (stupidly I didnt test this before) that when an asp text
box is invisible ie visible= false the client side sript that writes
to it shows an error- ie cant write to it. I have tried adding an
attribute ie textbox.Attributes.add of type hidden but to no avail.

Any clues?

Dan

Mar 14 '07 #2
The correct way is to use a hidden input control, as another poster said.

There is still a way of hiding any control and still have it available on
client side and on postbacks. That is to hide it with a css rule
display:none.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"DanWeaver" <da*********@googlemail.comwrote in message
news:11**********************@l75g2000hse.googlegr oups.com...
Due to the lack of persistence in a listbox element across postbacks I
have been forced to use textboxes to gather eg removed items (removed
via a javascript) so that the listbox can be repopulated on postback
amongst other things.

I now find (stupidly I didnt test this before) that when an asp text
box is invisible ie visible= false the client side sript that writes
to it shows an error- ie cant write to it. I have tried adding an
attribute ie textbox.Attributes.add of type hidden but to no avail.

Any clues?

Dan

Mar 14 '07 #3
"DanWeaver" <da*********@googlemail.comwrote in message
news:11**********************@l75g2000hse.googlegr oups.com...
Due to the lack of persistence in a listbox element across postbacks I
have been forced to use textboxes to gather eg removed items (removed
via a javascript) so that the listbox can be repopulated on postback
amongst other things.

I now find (stupidly I didnt test this before) that when an asp text
box is invisible ie visible= false the client side sript that writes
to it shows an error- ie cant write to it.
That's right - controls whose Visible property is false do not actually get
rendered down to the client...
I have tried adding an attribute ie textbox.Attributes.add of type hidden
but to no avail.
You can add pretty much any attribute you like to controls but, unless it's
an attribute which the browser recognises (e.g. onclick, onblur, style etc),
it will simply be ignored client-side.
Any clues?
http://msdn2.microsoft.com/en-au/lib...ddenfield.aspx
Mar 14 '07 #4
Thanks all, I'll have a try

Dan
On Mar 13, 9:06 pm, "DanWeaver" <danofwea...@googlemail.comwrote:
Due to the lack of persistence in a listbox element across postbacks I
have been forced to use textboxes to gather eg removed items (removed
via a javascript) so that the listbox can be repopulated on postback
amongst other things.

I now find (stupidly I didnt test this before) that when an asp text
box is invisible ie visible= false the client side sript that writes
to it shows an error- ie cant write to it. I have tried adding an
attribute ie textbox.Attributes.add of type hidden but to no avail.

Any clues?

Dan

Mar 14 '07 #5

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

Similar topics

1
by: abcd | last post by:
I have an ASP page which has 2 list boxes. When the selection changes from L1 it runs another asp page in hidden frame (hidden1), that page will do some database fetch and will set some control...
4
by: WB | last post by:
Hi, I need to validate a hidden input in my webform to ensure that it's got value. The controls look something like this: <input id="HidSelectedStates" type="hidden" runat="server" /><br...
11
by: Edson Peacock | last post by:
I have a report with sub reports, one of the subreports have 12 text boxes that are 2" high and I want them all to grow if one goes to 3" high. If anyone has any suggestions they are very much...
1
by: SSG | last post by:
Dear All, I have 10 text boxes... first 5 text boxes e visible , rest of the 5 are hidden... once i clicked the button , the hidden boxes should be visble.. can anyone help me hpw to write...
1
by: zwieback89 | last post by:
Hi, I have a org tree with hierarchical display of employees built using classic asp and vbscript. I also have list of radio buttons for report names. I have 1 select box with dates in it....
11
by: geoffbache | last post by:
Hi, As part of my efforts to write a test tool that copes with GUIs nicely, I'm trying to establish how I can start a GUI process on Windows that will not bring up the window. So I try to hide...
4
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
1
by: selvialagar | last post by:
i have two select boxes in my form named month and year...when i selected these two things, there is a submit button called 'generate invoice'. when i click this, invoice report is generated as a...
1
by: Nagel Oxles | last post by:
My form has has seven Text Boxes to receive user input. Users fall into either of two categories, Current and New. 'Command_Button_New' changes the visible property of four text Boxes and their...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.