Forum Moderators: open

Message Too Old, No Replies

Radio Button to Hidden Form field

need to make sure it still has checked attribute...

         

newnewbie1

9:00 pm on Nov 27, 2002 (gmt 0)

10+ Year Member



I have the following radio button:

<input type="radio" name="ecmsearchtype" value="AND" checked>

And I need to turn it into a hidden field... That's easy,
you just do this:

<input type="hidden" name="ecmsearchtype" value="AND">

But what about the checked attribute? How can you fake out a hidden field like it was checked?

Arrrghhhh! Can this be done?

seindal

9:25 pm on Nov 27, 2002 (gmt 0)

10+ Year Member



A hidden field is always 'checked', just as a type=text field is always present.

You get name=value pairs from the browser, also for radio-buttons where the value="xxx" determines the value sent and the common name="yyy" for a group of radio-buttons determine the name.

On the server you just see name=value pairs and there is no way you can determine if it was a text-field, a hidden field a checkbox or a radio-button.

So, don't worry. Just leave out the checked attribute on the hidden field, because it makes no sense there.

René.