View Full Version : Hidden Input Button in a Loop

10-05-2007, 11:07 AM
I am grabbing a list of emails and names in a for loop where i am using input hidden buttons to use them to post selected values and names. The problem,
the entire data list is getting displayed in an iframe where these hidden input buttons are getting displayed as empty spaces inside the div due tho which the page is getting dragged and distorted.

As the loop count increases, the no of input hidden buttons inside the loop increases and the page gets expanded.

How can i resolve this .

Thanks for the help in advance

10-05-2007, 05:49 PM
Add a class of "hidden" to the hidden inputs. Then, in the CSS:

input.hidden {
display: none;

I have to do this a lot. In a perfect world, you would use an attribute selector so you don't need the extra class:

input[type='hidden'] {
display: none;

…but guess who doesn't support it? ;)

10-07-2007, 12:09 AM
Ummm... let me think about that for a minute...


10-08-2007, 01:41 AM
If you have images on the page at all, you could use an image map. You would assign the button to a tiny area so you could still find it easily, but no one would know it was there.

Image maps: http://www.kasparius.com/tutorials/imagemap/how.htm
you could maybe even apply "cursor:default;" to completely hide it(it will display the regular arrow even though its a link)

Hope I helped,

actually you wouldn't even need an image already... If you do stick with the image maps, but if you dont you could make a 1px by 1px link or transparent gif or something with the cursor hidden...