Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox Form Control 1

Status
Not open for further replies.

TamedTech

IS-IT--Management
May 3, 2005
998
GB
Hello Guys,

I've got a form that allows users to enter the start and end times for an event into two small text unput fields on the form.

Now what I'm looking to do it have a little checkbox for 'this is an all day event' which can be checked, which then disables or hides the two text fields.

Has anyone got example of a nice lightweight implementation for somthing like this?

My JS knowledge is pretty much non exsistant, so any help is greatly appreciated.

Cheers guys,

Rob
 
Hi

Huh ? [3eyes]
JavaScript:
function ch(what)
{
  what.form.from.disabled=what.checked;
  what.form.to.disabled=what.checked;
}
HTML:
<input type="checkbox" onclick="ch(this)"> This is an all day event ...
<input type="text" name="from"> - <input type="text" name="to"> ... or not

Feherke.
 
Heh!

As simple as that eh? thats great stuff, thanks feherke much appreciated.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top