1 / 15

Select (drop-down list) Inputs

Select (drop-down list) Inputs. Insert/Form/List Menu. Fill in dialog box. Right click on the drop-down list and select List Values. Or just click on the List Values button in the Property Inspector. Add labels (shown) and values (hidden) and click the + button.

talleya
Télécharger la présentation

Select (drop-down list) Inputs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Select (drop-down list) Inputs

  2. Insert/Form/List Menu

  3. Fill in dialog box

  4. Right click on the drop-down list and select List Values Or just click on the List Values button in the Property Inspector

  5. Add labels (shown) and values (hidden) and click the + button

  6. Code View of Select (Drop-down list)

  7. Simple select handler code

  8. The value of the selected item is passed to the server

  9. Using a switch statement to display different output based on user’s input

  10. The switch statement • A switch is a fancy version of an if used when there are several “cases” – various situations (sets of statements) that might be executed depending on the outcome of a single value. switch($session) • In this case there are variations on the text printed based on the $session variable passed from the user using the POST method.

  11. A case case "BB1_6_29": print "<p>June 29, 10:00 - 12:00</p>"; print "<p>Blackboard Introduction covers the basics to get one started.</p>"; print "<p>Location: Olney 200</p>"; break; • Starts with the keyword case • Followed by the value signaling that case • Followed by the statements to be executed in this case • Followed by the keyword “break” to denote the end of the case and prevent them from running into each other

  12. Result

  13. Another approach using a array

  14. Arrays • An array is a set of related variables – in this case the set of strings that might be printed. • The individual elements of the array are specified by their index or key • It’s usually referred to as an index if you use a number, e.g. 0, 1, 2, … • It’s usually called a key if you use a string, e.g. ‘BB1_6_29’, as done here

  15. Specifying an element print "<p>You have chosen $session.</p> $workshops[$session]"; • In the statement above the code $workshops[$session] refers to the element of the array that has the key that was sent by the user in the POST method.

More Related