PHP + HTML form with select Restrictive

Asked

Viewed 86 times

1

Greetings. I am starting in this area of dev and entered into a challenge to develop a restrictive form.

What is?

  • in this simple example I will use 3 selects

1 condition validation option value = "AM" option value = "PM"

2 - Containing times for morning
example
option value = "01:00"
option value = "02:00"
option value = "03:00"
option value = "04:00"

3 - Containing times for afternoon/night
option value = "13:00"
option value = "14:00"
option value = "15:00"
option value = "16:00"


When selected in the first select the AM option, the application calls the Select for the morning and when we select the PM option, we will do the same with the other form.

Help me please.

I use PHP, HTML and CSS. Some light that someone can give me ? Thanks in advance for your attention.

1 answer

1


You will need to use javascript or Jquery to make it easier, with PHP you would have to switch pages for each select.

First you must create the 3 select`s on the page After this hide the 2 hours with the display property: None; in CSS

and when selecting AM or PM the javascript of a display: block; in the element to appear

Here it is https://jsfiddle.net/4cwpvapg/

  • Felipe. Thank you so much for the help. That’s exactly what it was :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.