Hello!
I load my form from a son file …
“myForm.loadStruct(”./analytics1/formEric.json", function(){});"
How do I do this at the same time?
“myForm.setItemValue(“x_y_z”, 0);”
I started with the form IN the webpage, in a json-like-text. When the form text was PART OF the doOnLoad command, everything worked perfectly. NOW, I extracted the form to an external son file (see above) and all my form modifying lines (like multiple setItemValue & things like… “document.getElementsByName(“form_element”)[0].value = <?php echo ($loggedIn)?$_SESSION["userID"]:0;?>;”)… all of these form-modifying lines don’t work AND show errors in the debug console.
Do i have the lines in the wrong order??
How do I include form-modifying code into this page? how/where? do i put all the form-modifying-code in an external js file or something & include the js file into the head?
Here’s a short-hand of the pages’ code…
function doOnLoad() {
var myForm = new dhtmlXForm(“vp”);
var dp = new dataProcessor("./analytics1/timewarp.php");
var dhxCalendar = myForm.getCalendar(“myCalendar”);
//dp.init(myForm);//link form to dataprocessor
myForm.loadStruct("./analytics1/formEric.json", function(){});
//set some default values.
myForm.setItemValue(“time_analyst_confidence”, 0);
myForm.setItemValue(“time_classification”, 2);
myForm.setItemValue(“time_agent_ID”, 0);
myForm.setItemValue(“time_work_location”, 0);
etc…
Close head & close doOnLoad…
Entry Page