Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Howto add js string like "onchange.." to an input

phpMyEdit General     Howto add js string like "onchange.." to an input
Post new topic   Reply to topic    
 
nnath     Joined: 22 Oct 2006   Posts: 1  
Post Posted: 2006-10-22 08:41
Back to top  Reply with quote     

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     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2006-10-26 17:40
Back to top  Reply with quote     

it's not easily possible.

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

 
KarelB     Joined: 01 Jun 2007   Posts: 24  
Post Posted: 2007-06-01 16:16
Back to top  Reply with quote     

nnath wrote:
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     Joined: 12 Mar 2005   Posts: 2  
Post Posted: 2007-12-13 02:01
Back to top  Reply with quote     

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

 
sba     Joined: 31 Jul 2008   Posts: 12  
Post Posted: 2008-11-13 11:29
Back to top  Reply with quote     

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:
Code:

$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é     Joined: 22 Feb 2013   Posts: 3  
Post Posted: 2013-03-12 21:49
Back to top  Reply with quote     

It does not work, you got any solution?

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy