Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3441180
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:31:18+00:00 2026-05-18T08:31:18+00:00

I am currently validating user input on server side (PHP). The client side sends

  • 0

I am currently validating user input on server side (PHP). The client side sends XMLHttpRequest calls and marks invalid fields with red borders. Everything else is great except that I think it takes too long for the client to make a request and then notice that he filled something wrong. I think I should place some JavaScript validations as well so that the client does not need to wait for the request to finish.

However, I do not want to duplicate validation rules and code. Has anyone implemented validation on both sides so that you do not need to duplicate validation rules at least?

I am using Yii and plain old JavaScript with jQuery if that matters.

Edit: I also find it tedious that the client may have a wrong time on his computer making JavaScript based datetime checks bad. This means I would need to give the right datetime from the server to the script first.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:31:19+00:00Added an answer on May 18, 2026 at 8:31 am

    I believe PEARs quick forms allow your to add validation for both client and server side at the same time.

    Since you are using the Yii framework and Yii provides a fairly robust validation scheme I’d look at some way of extending the form generation framework to check the fields for a validator, then map each of the validation classes to a js function that you should be able to write quite quickly.

    There also appears to be an extension that will do this for you : http://www.yiiframework.com/extension/jformvalidate/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently validating a client's HTML Source and I am getting a lot
I currently have a fairly robust server-side validation system in place, but I'm looking
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Currently I have a service that uses a UserNamePasswordValidator to authenticate the client user.
I've got the common situation where I've got user input that uses a subset
For the ASP.NET validator controls, I want to use both client-side validation for the
Currently I have an edittext field that when the user presses enter it does
I am currently receiving this error: Validation of viewstate MAC failed. If this application
I am currently writing some unit tests for a business-logic class that includes validation
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.