Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khianvictorycalderon/php-form-demo
A form demo for PHP with simple validation
https://github.com/khianvictorycalderon/php-form-demo
back-end-server css form-template javascript php php-back-end php-form-demo
Last synced: 2 days ago
JSON representation
A form demo for PHP with simple validation
- Host: GitHub
- URL: https://github.com/khianvictorycalderon/php-form-demo
- Owner: khianvictorycalderon
- Created: 2024-12-15T02:23:12.000Z (8 days ago)
- Default Branch: main
- Last Pushed: 2024-12-15T02:32:34.000Z (8 days ago)
- Last Synced: 2024-12-15T03:21:33.502Z (8 days ago)
- Topics: back-end-server, css, form-template, javascript, php, php-back-end, php-form-demo
- Language: PHP
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Form with Validation
This form allows the user to submit their name and age. It includes JavaScript validation to ensure the name input doesn't contain special characters or numbers. Upon successful submission, a custom alert displays the entered values.
## Instructions:
1. **Files Needed:**
- HTML file (contains PHP form logic)
- `assets/index.css` (custom CSS file)
- `assets/index.js` (JavaScript for validation)2. **How It Works:**
- The user is prompted to enter their name and age.
- When submitting the form, the JavaScript function `validate()` checks the name field to ensure no special characters or numbers are present.
- If both fields are valid, the form is submitted, and PHP handles displaying a custom alert with the name and age values.3. **PHP Script:**
- The `alert()` function in PHP triggers a browser alert with the input values when the form is submitted and both fields are filled.4. **Key Functionalities:**
- **Form Validation:** Ensures no special characters or numbers in the name field.
- **Form Submission:** PHP processes the form after validation, triggering a JavaScript alert with the form data.5. **Customizations:**
- You can modify the PHP alert functionality to display or process form data as needed.
- Update `index.css` and `index.js` for your own styling and validation rules.