I want to write custom module for contact us form, I can not understand how to get started, i made two files(form_module.info and form_module.module) in module>form_module then added
core = "7.x"
description = "An example module used to learn module development and forms creation."
name = "Form Module Module"
in my .info file. Then added below code in my .module file
<?php
function form_module_form($form, &$form_state) {
$form['submit_button'] = array(
'#type' => 'submit',
'#value' => t('Click Here!'),
);
return $form;
}
?>
is this correct? and how to add this form to my page--contact-us.tpl.php template?
Drupal 7 contact us form custom module
364 Views Asked by nomeer At
1
There are 1 best solutions below
Related Questions in DRUPAL-7
- Drupal 7 saving content each time i upload an image
- In which database table is the list of files attached to a node?
- Upgrade the drupal 7.88 to drupal 10.1.1
- Drupal 7 to Drupal 9 through web browser upgrade - "files do no exist"
- I've received an export 'network error' in attempt to export a database from phpMyAdmin
- Drupal 7 Incorrect spam bot errors on different browsers
- Drupal 7 | Uncaught ArgumentCountError: Too few arguments to function _drupal_error_handler()
- I need to add a webform block in drupal 7 for a custom theme
- imperva WAF rules blocked drupal 7 form submit
- Issue with Drupal 9 Visitor Counter Module: Visitors Count Not Updating
- how to add Language in drupal 7.09
- Attempt to create field name which already exists and is active
- Can i customize html and css in $page[content] in drupal 7?
- CDK toolbar does not appear on Drupal 7
- PHP refuses update because in server root, Drupal 7 (php7.3) & Drupal 10 (PHP 8.1) on the same server both working - Can't update D10
Related Questions in CONTACT-FORM
- Height of input box on Contact 7 form
- Contact Form fails to send out an email
- How to add action for custom form in wordpress?
- Why doesn't this PHP code send e-mails?
- Error in Contact form
- php help redirect contact form to thank you page
- Codeigniter PHP Mailer, Sender Info
- PHP script not validating input
- PHP contact form with nocaptca recaptcha
- Contact form with html and php
- Customizing a contact 7 form so email address sent to is based on variables chosen
- PHP contact form goes to a blank page
- How do I configure my "leave a message" form with MailChimp on an HTML/CSS template?
- Contact Form using Gmail SMTP server C# ASP.NET. UPDATED CODE?
- Formspree: error message | Can't send an empty form
Related Questions in DRUPAL-FAPI
- Drupal 7 date_popup form element wrong value submitted
- Disable Arrows on input type="number" without javascript
- How to create an image button that behaves like a button in drupal 7?
- Drupal FAPI: How do I change a value in the validation function?
- Drupal 7 user registration custom
- Drupal 7 contact us form custom module
- How to dynamically remove field in Drupal 7 custom form using AJAX
- In Drupal after selecting a value in an autocomplet, I need to load field values from a database record
- How can I set ID attribute for drupal 7 form elements?
- Apply custom page template to content from Drupal 7 module
- Drupal 7 Form API Theming #autocomplete textbox with long text
- Drupal 7, default_value for a file field in a custom form
- Drupal 7 -- #AJAX Refresh not displaying drupal_set_message errors
- how to override a web form submit function in drupal7?
- Run JavaScript on form submit in Drupal 7
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This looks right, but you'll need to write a bit more code to generate the page that you want this to show up on.
You could also use Webform for setting up the form.
If Webform is not something you want to mess around with, then here is what you'll need to do:
That will generate the page that you want called "Contact Us". You've got quite a bit more that you'll need to do within the Drupal API to get this working.
Let me know if you need help. I'd be glad to point you in the right direction.