This topic is locked

Custom Dropbox Problem

1/29/2013 2:28:54 PM
PHPRunner General questions
G
gino author

Hi

I was trying to append items to a managed to create a design field set to "lookup wizard list values" which makes it a dropbox. As I could not get this to work I created a custom dropbox via snippet
echo "<select name=\"family\" id=\"family\"><option value=\"\">Seleziona una famiglia</option>";
then in javascripyt onload with ajax i call a php routine to select and fill values in dropbox

This works only problem is how to I then set my record field to the dropbox selected item or better still can I fill the record field defined as dropbox within the ajax code (i could not get this to work)
// Place event code here.

// Use "Add Action" button to add code snippets.

var ctrlcilin = Runner.getControl(pageid, 'CILINDRO');
var ctrlsfero = Runner.getControl(pageid, 'SFERO');

var ctrlfam = Runner.getControl(pageid, 'FAMIGLIA');

var ctlrcol=Runner.getControl(pageid, 'COLORE');
//var famid = document.getElementById("FAMIGLIA").id;

//var famid = ctrlfam.fieldName;
//alert (famid);

ctrlfam.setDisabled()

ctrlfam.fieldName.appemd
ctrlcilin.on('change', function(e)

{

//str=ctrlsts.getValue()
//{

var xmlhttp;
//if (str=="")

//{

//document.getElementById("txtHint").innerHTML="";

//return;

// }

if (window.XMLHttpRequest)

{

// code for IE7+, Firefox, Chrome, Opera, Safari

xmlhttp=new XMLHttpRequest();

}

else

{

// code for IE6, IE5

xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

}
str=ctrlsfero.getValue();
//xmlhttp.open("GET","gettablegv.php?q="+str,true);

//ctrlcls.setValue("hello2");

//xmlhttp.send();

//ctrlcls.setValue("hello3");

$.ajax({

url:"GETFAMILY.PHP",

method:"get",

data:{

q:str

}
}).done(function(data){

//$('#fam').append(data);
$("#family").empty();

$("#family").append(data);

// $("FAMIGLIA").append(data);

// $("#FAMIGLIA").append(data);
alert(data);
// $("#family").append("<option value='1'>Apples</option>");
// $('#test').empty()r
});
//}
});
thanks for any help in advance