Gift Card Order Form
Allow your customers to order or purchase a gift card online with our gift certificate order form. The form asks a customer to select the value of a gift card from a predefined list, the names and contacts of the customer and recipient, and the shipping address. The PayPal payment gateway is integrated into the form. A customer can proceed with the payment instantly after submitting the gift card request.
Structure and logic of the form
-
The form content is organized with Grid containers. Use grids in a form design to simplify layout, ensure consistency, and enhance the user experience.
-
Custom buttons represent gift amounts. The highlightSelectedAmount() function highlights a button with the corresponding amount.
-
An HTML control is added with the PayPal buttons code snippet.
JavaScript
-
Click handlers of the gift buttons populate the Amount field.
-
The highlightSelectedAmount() function is called each time the Amount field changes and on the form load, and highlights the selected amount.
-
The function within the saved() event hides the form and shows PayPal buttons. The variable giftAmount holds the value of the Amount field.