Jump to content

Form Validation with PHP and JavaScript


Recommended Posts


    After finishing up the PHP course I have recently started the Form Validation with PHP and JavaScript project as I expect this will be something I'll do quite often. I have run into a snag or two here. The videos teach great concepts, but the plug-in used in lesson 2 with jQuery is no longer available. 

Preview attachment validation.plug-in.site.png

Preview attachment form-php-video.png

1.1 MB

Preview attachment form-php-video2.png

I've followed along writing out the code for the sake of writing it out, but it can't work correctly without the actual plug-in's code to copy and paste into a page. 
The video shows how to make some of the inputs required by adding a few classes to them.
Then to use a validate method in the head of the page in a script block.
Preview attachment validate-script-block-head.png
The video then shows some code that is copy and pasted from the plug-in site into our validate method using an expression to check to make sure the phone number is valid, as well as a modifiable message to be displayed if the field needs to be corrected. 
This code is also dependent on being able to copy and paste the plug-in code into a page. 
Preview attachment code_copied_unavailable.png
Chatting earlier today in the zoom meeting, you'd said to post screen shots and describe what I was encountering. 
Please let me know if these won't  suffice or if there is something else I should be sending you as an example? 
Otherwise, does anyone have a comparable plug-in they can recommend? 
Edited by KCook
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...