1
gagaumoura
how to get action in button
  • 2006/7/17 19:08

  • gagaumoura

  • Just popping in

  • Posts: 5

  • Since: 2006/7/14


how i can get the action in xoopsFormButton , BUTTON.. not submit!!

i click in the button and not happenn!!

i am portuguese , and dont speak english very well.

thanks!!!

i want that click in button (xoopsFormButton) and open the new url (poup-up).. how?

2
Daigoro
Re: how to get action in button
  • 2006/7/17 20:41

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


________________________________
EDIT:
It appeats I can't write "java script:" without the space, or the forum will change it into (tammairanslip).
Please remove the spaces yourself.
________________________________

The XoopsFormButton is defined in /class/xoopsform/formbutton.php like this:

function XoopsFormButton($caption, $name, $value="", $type="button")

The type of the button can be "submit", "reset" or "button" Button is default.

The name string is also used for the ID.

Here's an example on how to add it to your form:

$my_button = new XoopsFormButton('My test button''SomeName''ValueOrCode''button');
$form->addElement($my_button);


Since you want a popup, I suggest you add some javascript to the value string.
Something like this:
$my_button = new XoopsFormButton('My test button''SomeName''java script:openWithSelfMain("".XOOPS_URL."index.php","MySite",450,380);''button');
$form->addElement($my_button);

Note; The above code is untested - but should be pretty close to the real deal.

Hope it helps.

I'm Danish, so portuguese isn't my storng side...
Luckily translate.google.com provided this translation:
*******************************************************
________________________________
EDITAR:
Ele appeats eu não posso escrever de “o certificado java: ” sem o espaço, ou o forum mudá-lo-á em (tammairanslip). Remover por favor os espaços você mesmo.
________________________________


O XoopsFormButton é definido em /class/xoopsform/formbutton.php como este:

function XoopsFormButton($caption, $name, $value="", $type="button")

O tipo da tecla pode ser “submit”, "RESET" ou tecla da “button” é o defeito.

A corda conhecida é usada também para o ID.

Está aqui um exemplo em como adicioná-la a seu formulário:

$my_button = new XoopsFormButton('My test button''SomeName''ValueOrCode''button');
$form->addElement($my_button);


Desde que você quer um popup, eu sugiro que você adiciona algum Javascript à corda do valor.

Qualquer outra coisa semelhante:
$my_button = new XoopsFormButton('My test button''SomeName''java script:openWithSelfMain("".XOOPS_URL."index.php","MySite",450,380);''button');
$form->addElement($my_button);

Nota; O código acima é untested - mas deve ser bonito perto do negócio real.

Esperança que ajuda.
Best regards,
Daigoro

3
gagaumoura
Re: how to get action in button
  • 2006/7/18 18:21

  • gagaumoura

  • Just popping in

  • Posts: 5

  • Since: 2006/7/14


this code does not function!!!

somebody help me ?

4
Daigoro
Re: how to get action in button
  • 2006/7/18 19:39

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


This time I actualy tested the code, before submitting it.
This is working on my 2.0.14:

Again, please remove the space in "java script" below:

$my_button = new XoopsFormButton('My test button''SomeName''popup' onclick='java script:openWithSelfMain("'.XOOPS_URL.'/index.php","MySite",450,380);''button');
$form->addElement($my_button);


And note... This is a HACK!
Best regards,
Daigoro

Login

Who's Online

501 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 501


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits