By pan69 on
Hi.
I have this form with a button on it:
$form['filter']['export'] = array(
'#type' => 'button',
'#value' => t('Export...'),
);When I press the button I want it to perform an action by triggering a url, e.g. "admin/myform/export".
What would be the best way of doing this?
Thanks,
Luke
Comments
using _form_submit hook you
using _form_submit hook you can check the op values, based on the value you can do your action for example
--
Kamalakannan S
Kiluvai Tech Solutions Private Limited br Blog
Hi. Thanks for that. However,
Hi. Thanks for that. However, I don't think hook_form_submit exists for Drupal 6. Do you happen to know what I should use for Drupal 6 instead? I've been checking out the API but I can't seem to find it.
Thanks,
Luke
hi, the example i shown is
hi,
the example i shown is for drupal 6 only, if you want
go through this http://api.drupal.org/api/file/developer/topics/forms_api.html
in the above link see the Submitting Forms section where it explains form submitting
have a nice day
--
Kamalakannan S
Kiluvai Tech Solutions Private Limited br Blog
Hi. Sorry but I'm using
Hi. Sorry but I'm using Drupal 6. Then hook_form_submit is not being triggered when I implement it. I also can't find it in the API reference for 6...
I solved my problem by setting the '#action' property of the form when I build it:
Thanks,
Luke
How do I do this when my
How do I do this when my button is in a node, rather than a form?
Thanks
Glenn
Glenn
THECA Group
Bump Can anyone help me do
Bump
Can anyone help me do this on a node?
Thanks
Glenn
Glenn
THECA Group
Hi
Hello,
thanks for your code but I have some problem while using above form action..
$form['#action'] = url('xxxx');
$form['#method'] = 'post';
$form['id'] = array ('#type'=>'hidden', '#value'=>$Id);
$form['submit'] = array ('#type'=>'submit',
'#title'=>t('Back'),
'#value'=>'Back',
'#size' => 40,
);
here I am trying to go back to previous page and I'm posting the Id value to that page...
but here when I clicked on Back submit it is not going back to previous page just refreshing in the same page.
Please help me with this..
Thanks in advance..
i have validation problem mention form action
i mentioned form action but validation not tigger it is directly goes to action url without validation
how to solve this problem
Link
Hello,
The link you've provided is a dead link. Do you know any solutions for this in Drupal 8?
EDIT: I've used WayBackMachine to view your shared link. Sorry for the bother.
https://web.archive.org/web/20120101195055/http://drupal.org/node/751826