I am using same Xform code of voting, which is given in public template. But when i am submiting the form value is not going in to the database and validation of input field is also not working.
For validation, make sure you have a ValidationSummary control on the page with the proper ValidationGroup set (XForm by default in PublicTemplates). For the database issue, make sure the form you created in edit mode actually is set to save in the database. You can also debug this, in global.asax you have a few methods that are attached to various XForm events you can set breakpoints on (depending on which version of EPiServer you're using that is..).
Hope this helps.