Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 18. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Howto add js string like "onchange.." to an input

phpMyEdit General     Howto add js string like "onchange.." to an input
Odoslať novú tému   Odpovedať na tému    
 
nnath     Založený: 22.10.2006   Príspevky: 1  
Príspevok Zaslal: 2006-10-22 08:41
Návrat hore  Odpovedať s citátom     

Hi,

I need to add a javascript string like "onchange.." to an input element or select element.

Could not find anything in the manual.


Nikh Nath

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2006-10-26 17:40
Návrat hore  Odpovedať s citátom     

it's not easily possible.

however have a look at 'php' option, it will create any html code as field value.

 
KarelB     Založený: 01.06.2007   Príspevky: 24  
Príspevok Zaslal: 2007-06-01 16:16
Návrat hore  Odpovedať s citátom     

nnath Napísal:
Hi,

I need to add a javascript string like "onchange.." to an input element or select element.

Could not find anything in the manual.


Nikh Nath


I am looking for a similar feature. Did you manage to solve and if so, how?

Cheers

KArel

 
TheEarl     Založený: 12.03.2005   Príspevky: 2  
Príspevok Zaslal: 2007-12-13 02:01
Návrat hore  Odpovedať s citátom     

$opts['buttons']['L']['up'] = array(
'add',
array(
'code' => '<input type="button" value="Go to Index" onclick="window.location=\'index.html\';return false;" />'
),

 
sba     Založený: 31.07.2008   Príspevky: 12  
Príspevok Zaslal: 2008-11-13 11:29
Návrat hore  Odpovedať s citátom     

i hacked the function display_change_field by adding one line and modifing one line.
see bold code below:


function display_change_field($row, $k) /* {{{ */
{
$css_postfix = @$this->fdd[$k]['css']['postfix'];
$css_class_name = $this->getCSSclass('input', null, true, $css_postfix);
$escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true;
$js = isset($this->fdd[$k]['js']) ? $this->fdd[$k]['js'] : null;
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"';
echo $this->getColAttributes($k),">\n";
if ($this->col_has_values($k)) {
$vals = $this->set_values($k);
$multiple = $this->col_has_multiple($k);
$readonly = $this->readonly($k);
$strip_tags = true;
//$escape = true;
if ($this->col_has_checkboxes($k) || $this->col_has_radio_buttons($k)) {
echo $this->htmlRadioCheck($this->cgi['prefix']['data'].$this->fds[$k],
$css_class_name, $vals, $row["qf$k"], $multiple, $readonly,
$strip_tags, $escape);
} else {
echo $this->htmlSelect($this->cgi['prefix']['data'].$this->fds[$k],
$css_class_name, $vals, $row["qf$k"], $multiple, $readonly,
$strip_tags, $escape, $js );
}
} elseif (isset($this->fdd[$k]['textarea'])) {
echo $this->htmlTextarea($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name, $k, $row["qf$k"]);
} elseif ($this->col_has_php($k)) {
echo include($this->fdd[$k]['php']);
} else {
.....

and then add the same in the function display_add_record()


now ist works with this definition:
Kód:

$opts['fdd']['ret_accr_cat'] = array(
   'name'      => $str_category,
   'select'   => 'D',
   'maxlen'   => 11,
   'values2' => $accrcats,
   'js' => 'onchange="setOptions(document.PME_sys_form.PME_data_ret_accr_cat.options[this.selectedIndex].value);"',
);



or do i misunderstand somthing and its already supported without hacking the class?

 
Paulinho Cé     Založený: 22.02.2013   Príspevky: 3  
Príspevok Zaslal: 2013-03-12 21:49
Návrat hore  Odpovedať s citátom     

It does not work, you got any solution?

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov