I want to create a custom block in which I want to show custom form.
Form will contain only two element.
- input box (
#centimeter
) - submit button
When this submit button is clicked I want to convert this centimeter in inch and display the result below this form and I want to show this in block in sidebar.
My questions:
- How to do this?
- I tried following link but don't know where to write the code - should I create any php file in some folder?
- What to do if I want to show this block as a page with some url like
/measurement/convert-cm-to-inches
http://kahthong.com/2013/06/create-your-own-custom-drupal-block-programmatically