Login   Register  
PHP Classes
elePHPant
Icontem

frame

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Forms generation and validation  >  All threads  >  frame  >  (Un) Subscribe thread alerts  
Subject:frame
Summary:call other program with frame
Messages:11
Author:flavio r
Date:2012-06-26 22:03:19
Update:2012-07-05 04:12:08
 
  1 - 10   11 - 11  

  1. frame   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-26 22:03:20
I'm trying to run these lines to call a php program that generates a pdf document.
It works in a form without the class formgeneration from a click button.

echo "<html>";
echo "<frameset frameborder=\"0\" cols=\"100%,*\" framespacing=\"0\">";
echo "<frame name=\"_blank\" src=\"imp_ordens_total.php?acao=$acao&id_ordem=$id_ordem_ori&id_ano=$id_ano_ori\">";
echo "</ frameset>";
echo "</ html>";

How and where I have to include this statement?
Where I tried, the program runs, it generates the PDF in Firefox and Chrome. In Opera when I return to the browse the window is frozen and in IE, nothing appears.

Thanks again.

  2. Re: frame   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-26 22:43:18 - In reply to message 1 from flavio r
The forms class does not output anything until you call the DisplayOutput function.

If you want to output a frame as a result of processing a a successfully validated from, just output that code that generates the frame HTML and do not call the forms output display functions.

  3. Re: frame   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-27 16:04:16 - In reply to message 2 from Manuel Lemos
Okay, better now.

But I found out because IE does not open the program that generates the PDF.

I'm using a few buttons on the form for operations, including, print, delete. Defined as follows:

$form->AddInput(array(
"TYPE"=>"submit",
"ID"=>"alterar",
"NAME"=>"acao",
"VALUE"=>"alterar",
"ACCESSKEY"=>"a",
"ONCLICK" => "if(!confirma_alteracao()){return false}",
"Content"=>"<img src=\"images/add.gif\" style=\"border-width: 0px;\" alt=\"Atualizar\" /> <u>A</u>tualizar Ordem"
));
$form->AddInput(array(
"TYPE"=>"submit",
"ID"=>"imprimir",
"NAME"=>"acao",
"VALUE"=>"imprimir",
"ACCESSKEY"=>"i",
"ONCLICK" => "if(!confirma_impressao()){return false}",
"Content"=>"<img src=\"images/print.gif\" style=\"border-width: 0px;\" alt=\"Imprimir\" /> <u>I</u>mprimir Ordem"
));

$form->AddInput(array(
"TYPE"=>"submit",
"ID"=>"excluir",
"NAME"=>"acao",
"VALUE"=>"excluir",
"ACCESSKEY"=>"e",
"ONCLICK" => "if(!confirma_exclusao()){return false}",
"Content"=>"<img src=\"images/subtract.gif\" style=\"border-width: 0px;\" alt=\"Excluir Ordem\" /> <u>E</u>xcluir Ordem"
));


To retrieve the User clicked the button, I do so:

$acao = strtoupper ($acao);

In the other browser the value of '$acao' is always the value of 'VALUE' button.
In IE the value of '$acao' is the value of 'Content' button.
If I do not set the 'Content' from the object, IE takes the value of 'VALUE'.

Do you have any other better way to do this?
Sorry to bother again.
I'll learn to use this class right with your help.

Thanks

  4. Re: frame   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-28 02:42:06 - In reply to message 3 from flavio r
You should not be accessing global variable to check submitted values as the register globals functionality may be disabled and even when it isn't, the submitted values may not have been cleaned up by the forms class.

Use the WasSubmitted function instead. Pass the ID value of the form input you want to test.

  5. Re: frame   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-28 15:02:02 - In reply to message 4 from Manuel Lemos
Sorry Manuel, but I did not understand how.

In the case of the button submited:
$form->AddInput(array(
"TYPE"=>"submit",
"ID"=>"alterar",
"NAME"=>"acao",
"VALUE"=>"alterar",
"ACCESSKEY"=>"a",
"ONCLICK" => "if(!confirma_alteracao()){return false}",
"Content"=>"<img src=\"images/add.gif\" style=\"border-width: 0px;\" alt=\"Atualizar\" /> <u>A</u>tualizar Ordem"
));

I would like this test?

$acao_a=$form->WasSubmitted("alterar");


I'm trying this, but nothing.

  6. Re: frame   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-28 20:48:40 - In reply to message 5 from flavio r
The WasSubmitted function returns a string which is the ID of the submit input that was used, or an empty string in case the specified input was not the one that was used.

  7. Re: frame   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-29 16:28:32 - In reply to message 6 from Manuel Lemos
Manuel

Teasing some more ...

How could I test this function (WasSubmitted) in the example 'test_form.php'?
Could show a fragment of code of where to put the function?
thank you

  8. Re: frame   Reply   Report abuse  
Picture of flavio r
flavio r
2012-07-02 18:22:55 - In reply to message 6 from Manuel Lemos
Manuel

With the example 'test_scaffolding_input.php' command 'wasSubmitted' shows the action executed after clicking the link view, update, delete:

...
/ *
* Load input values so the scaffolding input Can post event messages
* For handling by your application.
* /
Submitted $ = strlen ($form-> WasSubmitted (''))! = 0;

$acao = $form-> WasSubmitted ('');
echo ("<br> acao: $acao <br>");

$form-> LoadInputValues ($ submitted);
...

but in the 'test_form.php' I can not identify which button was pressed.
Is there anything else to configure?

  9. Re: frame   Reply   Report abuse  
Picture of flavio r
flavio r
2012-07-03 19:29:40 - In reply to message 6 from Manuel Lemos
Manuel

I found what was missing to set.

I will do more tests and if I need, I ask for more help.

Thanks

  10. Re: frame   Reply   Report abuse  
Picture of flavio r
flavio r
2012-07-04 19:30:46 - In reply to message 6 from Manuel Lemos
Manuel

Excuse the ignorance.
What is the difference when I call the program with a link and a button?
When I call the program for a button, '$form->WasSubmitted('')' returns nothing, but when I call for a link, it works.

 
  1 - 10   11 - 11