0

I use Drupal 7 and the Webform module.

How can I know if a form is submitted or not? I need this to show either error messages or success message after form submission in form page.

I prefer not to write a module because I think it is unnecessary to write a module for a very small task.

Some more info to further explain my question:

  • I already know about the setting for Webform per form. This setting is located "Content > Webforms(tab) > Edit(your form) > Webform(tab) > Form settings" (where you can add the confirmation message or redirect to a Custom URL).

  • Actually I render my webform in my node--contact.tpl.php and I use the Webform Validation module for my form validations. And with the form_get_errors function I get errors and loop through them and show them. And if submission is successful I show form successful submission message. I just don't know how to detect whether form is submitted or not.

closed as unclear what you're asking by Mołot, Scott Joudry, Krishna Mohan, Shawn Conn, kiamlaluno Jun 11 '15 at 16:24

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

0

There a setting for Webform per form. This setting is located "Content > Webforms(tab) > Edit(your form) > Webform(tab) > Form settings". You can add the confirmation message or redirect to a Custom URL.

  • I already know that actually I render my webform in my node--contact.tpl.php and I use webform validation module for my form validations.and with form_get_errors function I get errors and loop through them and show them. And if submission is successful I show form successful submission message. I just don't know how to detect whether form is submitted or not. – mhndev May 29 '15 at 20:10
  • @majid8911 Any submitted form data should be in "Results" tab – CocoSkin May 29 '15 at 20:38
  • sorry ! I didn't get you. where is results tab?? I'm new to drupal ! sorry if it seems stupid question ! I compared my webform object data after and before submission there wasn't any differences which I can detect form is submitted ! – mhndev May 30 '15 at 4:44
  • @majid8911 It located "Content > Webforms(tab) > Edit(your form) > Results(tab)". You can check them under "Submissions" or "Table" section. – CocoSkin May 31 '15 at 2:05
0

I solved this problem with drupal_get_messages() function ! the result of this function is different for when form is submitted and also for when form is not submitted.

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