0

Must I use webform in order to create a custom form? I need to create a form validator that will validate if a number (social security number) is valid. I've used webform for this but whatever I enter in the form, it's always storing it and I have to clear the data by going to admin. I dont want the webform to store user input. The point of the form is just to validate. Basically client side validation (or PHP side) is the only purpose of the form. No storage needed. Is there a way to turn off the storage in webform? Or do I have no choice but to store all inputs entered by users?

I've seen this but I dont want to redirect. My form is just an ajax call..

1 Answer 1

0

You can edit the form with function_form_alter(), and modify what to do on submit. Try this:

function MY-MODULE_form_alter(&$form, &$form_state, $form_id){
  if( $form_id == 'YOUR-FORM-NAME' ){
    $form['actions'][]= array(
      '#submit' => array('_CUSTOM_FUNCTION')
    );
  }
}
function _CUSTOM_FUNCTION(){
  //put what to do here
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.