[development] Passing parametre

Murat Günana mgunana at gmail.com
Wed Dec 4 13:24:27 UTC 2013


According to the form api it should be able to do that.


On 4 December 2013 13:17, John Morahan <john.morahan at gmail.com> wrote:

> '#type' => 'button' won't execute a submit callback, try '#type' =>
> 'submit'
>
>
> On 4 December 2013 13:16, Murat Günana <mgunana at gmail.com> wrote:
>
>> You shouldn't return anything in the callback function. you need to
>> remove "return $source" line from there.
>> Just for test purposes put this line in callback function and see if you
>> can get any form error form_set_error('iller_select', 'Error.');
>>
>>
>> On 4 December 2013 12:59, Muzaffer Tolga Ozses <tolga at ozses.net> wrote:
>>
>>> Look at
>>> http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=49adff05adea3549c4566c2cb2ec2ce2f6d5db08;hb=16ee60869975ca8794abc193e0713376945c0c02#l54. I made the changes you suggested and no dice :S
>>>
>>>
>>> On 4 December 2013 14:54, Murat Günana <mgunana at gmail.com> wrote:
>>>
>>>> implement your form submit element like;
>>>> $form['actions']['submit'] = array(
>>>>      '#type' => 'button',
>>>>      '#value' => t('Submit'),
>>>>      '#submit' => array('night_pharmacy_table'),
>>>>    );
>>>> and make sure you clear the cache.
>>>>
>>>>
>>>> On 4 December 2013 12:49, Muzaffer Tolga Ozses <tolga at ozses.net> wrote:
>>>>
>>>>> Thanks Patrick,
>>>>>
>>>>> Unfortunately, night_pharmacy_table never gets called, and I have no
>>>>> clue why. Do you happen to have an idea?
>>>>>
>>>>>
>>>>> On 4 December 2013 14:35, Patrick Dawkins <pjcdawkins at gmail.com>wrote:
>>>>>
>>>>>> night_pharmacy_table is a form submit callback. It already gets
>>>>>> passed the $form parameter; you have got the function signature wrong.
>>>>>>
>>>>>> So you need to change
>>>>>> function night_pharmacy_table($form_state) {
>>>>>> to
>>>>>> function night_pharmacy_table($form, &$form_state) {
>>>>>>
>>>>>>
>>>>>> Documentation here:
>>>>>> https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#submit_property
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 4 December 2013 12:14, Muzaffer Tolga Ozses <tolga at ozses.net>wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> This is really a PHP question, but it involves $form_state, so bear
>>>>>>> with me please.
>>>>>>>
>>>>>>> In my code at
>>>>>>> http://git.webciniz.im/?p=project/night_pharmacy.git;a=blob;f=night_pharmacy.module;h=132b5d4a90692acfadfe9e11af128f712df1c24d;hb=e89e63bb07f064898ca21be1c97aba221b4dbdaf#l57I want to be able to pass $form parameters to night_pharmacy_table, to no
>>>>>>> avail. Can you help me guys?
>>>>>>>
>>>>>>> Thanks in advance :)
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Kind regards,
>>>>
>>>> Murat Gunana
>>>> Tel: 07927964976
>>>> Email: mgunana at gmail.com
>>>>
>>>
>>>
>>
>>
>> --
>> Kind regards,
>>
>> Murat Gunana
>> Tel: 07927964976
>> Email: mgunana at gmail.com
>>
>
>


-- 
Kind regards,

Murat Gunana
Tel: 07927964976
Email: mgunana at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20131204/c0f76347/attachment.html 


More information about the development mailing list