131k views
4 votes
Within the creditcard selection list add the following options and values: Credit Card Type (leave the value as an empty text string), American Express (value="amex"), Discover (value="disc"), MasterCard (value="master"), and Visa (value="visa").

Make the selection list and cardname field required.

1 Answer

2 votes
Here's an example code snippet that adds the required options to the creditcard selection list and makes the cardname field required:

```
Credit Card Type:

Credit Card Type
American Express
Discover
MasterCard
Visa



Name on Card:

```

This code creates a selection list with the required options, starting with the "Credit Card Type" option that has a blank text string value. The `required` attribute makes sure that the user selects an option before submitting the form. The code also adds a required text field for the cardname input.
User Abdelahad Darwish
by
8.4k points