This topic is locked

display button when either of 2 elements change

2/16/2017 12:16:19 PM
PHPRunner General questions
S
stiven author

Hello,
I am trying to show a button when either one of two inputs are changed using jquery. I have accomplished this outside PHPRUNNER but when I put the code in the javascript onload event it does not work. here is an example of the code


/// this would be possible like this

$("#input1, #input2").change(function(){
////I have tried several options

1. $(tm_date.getDispElem().attr("id"),client.getDispElem().attr("id").change(function(){
var ids = '"#'+tm_date.getDispElem().attr("id")+', #'+client.getDispElem().attr("id")+'"';
2. $(ids).change(function(){
3.

$(tm_date.getDispElem(),client.getDispElem()).change(function(){



if(tm_date.getValue() != '' && client.getValue() != ''){

var url = '<a class="rnr-button" onclick="PopUp(\'check_hours.php?d='+tm_date.getValue()+'&id='+client.getValue()+'\',\'800\',\'650\',\'\',\'Hours Check\')" href="#">Hours Summary</a>';

$("#check_hours").append("<span>"+url+"</span>");

}else{

$("#check_hours span:last").remove();

}


});
admin 2/21/2017

Not sure what kind of suggestion you looking for here. As a first step see what Javascript error your code produces:

https://xlinesoft.com/phprunner/docs/troubleshooting_javascript_errors.htm