Validation For Html Control Without Form

I have a text field in a page. now it doesnot insert data or anything…its like equation is showed and user has to answer in that field. value of textbox will be checked with value in session. Now I want to validate this button with numeric fields and custom validation. I dont have a form in this page as the equations changes with ajax request.

I don’t understand that best to way implement validation

  1. Using active form mode

  2. custom javascript on the page


if there is any other way that such validations can be done without creating a model…

Use CFormModel and the inbuilt server side and client side validation that it provides. I don’t see any reason for avoiding a model, even for a simple form, especially if you want to be able to perform validation.