Login   Register  
PHP Classes
elePHPant
Icontem

form_mysql_auto_complete_class

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  >  form_mysql_auto_complete_class  >  (Un) Subscribe thread alerts  
Subject:form_mysql_auto_complete_class
Summary:property: visibility
Messages:17
Author:flavio r
Date:2012-06-13 22:04:27
Update:2012-06-25 14:02:51
 
  1 - 10   11 - 17  

  1. form_mysql_auto_complete_class   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-13 22:04:27
I'm having trouble with the class form_mysql_auto_complete_class. The browser is returning some errors:

[13/6/2012 17:24:52] CSS - http://site/servicos/cadastro_equipamentos_fg.php?___event=submit&___input=p_complete_id_unidade__ajax
HTML style attribute
Invalid value for property: visibility
Line 1:
:30px;height:10px;visibility:hidden;font-size:7px;color:#d0d0d0;visibility:show;
--------------------------------------------------------------------------------^

[13/6/2012 17:24:53] CSS - http://site/servicos/cadastro_equipamentos_fg.php?___event=getoptions&___input=id_equipamento_pai&___group=LDA
HTML style attribute
Invalid value for property: visibility
Line 1:
:30px;height:10px;visibility:hidden;font-size:7px;color:#d0d0d0;visibility:show;
--------------------------------------------------------------------------------^


When I run Opera in the error does not affect in the following fields, but when run in Firefox and IE the next field that needs the result of selection does not find the value to search the linked group.
Will I'm doing something wrong?

code:
...
$form->AddInput(array(
'TYPE'=>'custom',
'ID'=>'complete_id_unidade',
'NAME'=>'complete_id_unidade',
'CustomClass'=>'form_pgsql_auto_complete_class',
'CompleteInput'=>'id_unidade',
'CompleteMinimumLength'=>1,
'Dynamic'=>1,
'ShowButton'=>'mostra_unidades',
"Connection"=>'ServicosConnection',
"CompleteValuesQuery"=>"SELECT id_unidade FROM unidades WHERE lower(id_unidade) {BEGINSWITH} ORDER BY id_unidade",
"CompleteValuesLimit"=>10,
'FeedbackElement'=>'complete_id_unidade_feedback',
'SubmitFeedback'=>' <img src="../_phplib_/FormGeneration/indicator.gif" width="16" height="16" alt="Procurando Unidades" title="Procurando Unidades" /> ',
'CompleteFeedback'=>' <img src="../_phplib_/FormGeneration/indicator.gif" width="16" height="16" style="visibility: hidden;" /> ',
));

$form->AddInput(array(
"TYPE"=>"custom",
"ID"=>"id_equipamento_pai",
"NAME"=>"id_equipamento_pai",
"LABEL"=>"Equipamento <u>P</u>ai",
"ACCESSKEY"=>"P",
"CustomClass"=>"form_pgsql_linked_select_class",
"Connection"=>'ServicosConnection',
"GroupsQuery"=>"SELECT id_unidade FROM unidades",
"OptionsQuery"=>"SELECT id_equipamento FROM equipamentos WHERE id_unidade={GROUP} ORDER BY id_equipamento",
"DefaultOption"=>"",
"DefaultOptionValue"=>"Selecione Equipamento Pai",
"Dynamic"=>1,
"VALUE"=>$id_equipamento_pai,
"LinkedInput"=>"id_unidade",
"AutoWidthLimit"=>0,
"AutoHeightLimit"=>0,
"ValidateAsNotEmpty"=>1,
"ValidationErrorMessage"=>"Não é um equipamento válido.",
));

...

body:

<center><table summary="Input fields table">

<tr>
<th align="right"><?php $form->AddLabelPart(array('FOR'=>'id_unidade')); ?></th>
<td><?php
$form->AddInputPart('id_unidade');
$form->AddInputPart('complete_id_unidade');
?><span id="complete_id_unidade_feedback"></span></td>
</tr>

<tr>
<th align="right"><?php $form->AddLabelPart(array('FOR'=>'id_equipamento_pai')); ?></th>
<td><?php
$form->AddInputPart('id_equipamento_pai');
?></td>
</tr>

<td align="center"><?php
if(IsSet($verify["id_equipamento_pai"]))
{
?>
[Verify]
<?php
}
?></td>
...

  2. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-13 23:36:33 - In reply to message 1 from flavio r
The CSS visibility property cannot be show, you probably mean visible.

Anyway you should not be messing with that property for the menu style because it interferes with the actions of making the menu open and close.

  3. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-14 14:26:29 - In reply to message 2 from Manuel Lemos
Manuel, I found where was the wrong definition of visibility, even eliminating the error field with class "form_pgsql_linked_select_class" still does not work in IE and Firefox but Opera is perfect.
I noticed that in Opera when I make a tab on the field with class 'form_pgsql_auto_complete_class' the focus goes to the button that shows all the options, and in IE and Firefox the focus disappears and after another tab the focus go to the button that shows all options.
IE and Firefox identifies an object between the field and button?
Would any way to find where is the problem?
Thanks

  4. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-15 07:41:20 - In reply to message 3 from flavio r
It is hard to understand what you mean. Can you put a minimal example running in a Web page so I can see what you mean?

  5. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-18 21:23:59 - In reply to message 4 from Manuel Lemos
Manuel

If you can look at this link, you will see that in Opera you select a 'unidade' and opens the list in the field below, but in IE and Chrome does not work the link.
If you press tab in 'unidade' field, the focus goes to the button, but in IE and Chrome the focus disappears.

http://200.186.208.43:88/servicos/cadastro_equipamentos_fg.p ...

  6. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-19 00:22:40 - In reply to message 5 from flavio r
I cannot see this working in any browser.

I think you are having SQL errors but since the database interaction is going through AJAX requests, you cannot see the errors on the page.

Try enabling the PHP error log file in php.ini and take a look at what appears in the error log to see what database errors are happening.

http://www.php.net/manual/en/errorfunc.configuration.php#ini ...

  7. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-19 23:26:47 - In reply to message 6 from Manuel Lemos
Manuel
But if there were errors in SQL, not work in Opera, is not it? The queries are returning the expected results in my logs.
I did some more tests and noticed that in access logs php, web browsers, which are not working, do not enter into 'event getoptions =' of javascript, which assembles the list on the form.
Opera already runs (passes) this event, as copied below.
I'll keep looking, but if you have any idea what might be wrong, I appreciate it.

logs=
Opera e IE:
[19/Jun/2012:15:35:08 -0300] "POST /servicos/cadastro_equipamentos_fg.php?___event=submit&___input=p_complete_id_unidade__ajax HTTP/1.1" 200 864

somente Opera:
[19/Jun/2012:15:35:09 -0300] "GET /servicos/cadastro_equipamentos_fg.php?___event=getoptions&___input=id_equipamento_pai&___group=LDA HTTP/1.1" 200 16347




  8. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-20 01:27:10 - In reply to message 7 from flavio r
It is hard for me to tell because you are using a variant of the auto-complete plug-in for which I do not have the code. So my supposition that there some database access errors is just a guess. It may be true or not.

It would help to figure the problem if you enabled PHP error logs. You provided Apache logs, but those are not very useful because they do not reveal any PHP errors.

I suggest that you add these lines to your php.ini file:

error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 0
ignore_repeated_errors = On
ignore_repeated_source = Off
report_memleaks = On
track_errors = On
html_errors = Off
error_log = /path/to/php_error_log

Obviously you need to change /path/to/php_error_log to some path that is suitable to set the PHP error log file.

Then restart the Web server and run the script again. Just let me know if they reveal any errors triggered during the execution of the script.

  9. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of flavio r
flavio r
2012-06-20 23:32:19 - In reply to message 8 from Manuel Lemos
Manuel
The logs returned some errors listed below.
But I understand why you say that did not work in any browser in your tests.
When I use the button to open the list of options, the link does not really work with the next field. But when I type an option in Opera it updates the linked field.
There may be something with the javascript events?
Can I send the fonts for you take a look?

the logs shows:
[Wed Jun 20 15:25:04 2012] [error] [client ip] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/servicos/cadastro_equipamentos_fg.php:29) in /var/www/_phplib_/FormGeneration/form_ajax_submit.php on line 282, referer: http://pagina ip/servicos/cadastro_equipamentos_fg.php

[Wed Jun 20 15:24:58 2012] [error] [client ip] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/servicos/cadastro_equipamentos_fg.php:29) in /var/www/_phplib_/FormGeneration/form_linked_select.php on line 313, referer: http://pagina ip/servicos/cadastro_equipamentos_fg.php

Thanks again.


  10. Re: form_mysql_auto_complete_class   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2012-06-21 02:03:27 - In reply to message 9 from flavio r
Those errors are preventing it to work. It is not just in Opera. Here it does not work in any browser.

You need to see in line 29 of cadastro_equipamentos_fg.php something that generating page output. That is generating some output, maybe script errors displayed to the page, and that prevents the JavaScript code generated by the forms class AJAX plug-in to be sent to the browser. That is why it does not work.

 
  1 - 10   11 - 17