[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drupal-support
Subject:    [support] Submit a form from a link...
From:       lior.kesos () gmail ! com (Lior Kesos)
Date:       2007-01-30 8:35:20
Message-ID: 844fdde00701300035o21ffea84j2785dfbdbc12de34 () mail ! gmail ! com
[Download RAW message or body]

Hi,
I'm doing some privatemsg module hacking and my client want's to break the
"bunch of buttons" paradigm and to have a nicely styled message center.
I need to wrap some of the buttons with classy divs but that's not the
problem here..

I need to find a way to substitute a forms submit button with a link.
This is what I have so far...

 $form['new_folder'] = array(
      '#value' => '<a href="javascript:forms.privatemsg_list_form.submit()">New
folder</a>',
      '#name' => 'op'
      );

instead of something like this ..

  $form['new_message'] = array(
      '#type' => 'submit',
      '#value' => t('Write a new message'),
      '#name' => 'op'
      );

Now the form that receives this uses the value submitted to enter a case
clause so I need to pass the text as the submitted value...

switch ($op) {
    case 'list':
      $output = _privatemsg_list($arg);
      $title = t('Private messages');
      break;
    case 'view':
      $output = _privatemsg_view($arg);
      $title = t("Read message");
      $breadcrumb = array(l(t('Home'), ''), l(t('private messages'),
'privatemsg'));
      break;
    case t('Write a new message'):
      $arg = "";
    case 'form':

etc...

Any ideas or reference implementations?
Lior

---
????? ???? , ???????
http://www.linnovate.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20070130/ccdcb138/attachment.htm 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic