Hi All, I would like to know the procedure to do the following: I have to give the user an option to select whether he wants to give a particular date or a date range. (I used two radio buttons only one can be selected at a time) I have two date inputs which are deactivated by default. If user select only one date then I need to activate one date input and if he selects date range then i have to activate 2 date inputs. Can anybuddy help me out to make this done using basic HTML or JAvASCRIPT. Thanks a million for your help.. Regards,
You would need javascript for this as its a dynamic form, reacting to user choices. Search google for "dynamic javascript form" - there's a ton of stuff there.
You can use this simple code . <script language="javascript"> function DateOne() { myForm.T1.readOnly = false ; myForm.T2.readOnly = true ; myForm.T3.readOnly = true ; } function DateTwo() { myForm.T1.readOnly = true ; myForm.T2.readOnly = false ; myForm.T3.readOnly = false ; } </script> please see attached file .
radio buttons have always been quite a hard element in HTML to work with(or just sometimes). I had alot of problems with radio buttons, with validating a form, as you cannot just get the value of a set of radio buttons, you had to loop through all the raiod button elements and work in such a way and check each radio buttons' value... But anyways, hope alimkb's post will help ya