Hi,
i have a problem with chronoforms V6. In V5, i have 3 hidden fields populate as follow:
1) i have a check box with event "Check" that call a function, called "getdata".
2) Under Setup, "On Load", i have a "load javascript" action with the code:[pre]function getdata(){
var indirizzo = document.getElementById("indirizzo").value;
var comune = document.getElementById("comune").value;
var nome = document.getElementById("nome").value;
link = link.concat(comune,'/',nome);
document.getElementById("link").value=link; [mark]//SET FIRST HIDDEN VALUE [/mark]
var postData = {
"indirizzo" : indirizzo,[br] "comune" : comune[br] };[br][br] jQuery.ajax({[br] url: "/getCoordinatesFromAddress.php"[br] ,data: postData[br] ,type: "POST"[br] ,contentType: "application/json"[br] ,dataType : "json"[br] }).done(function( json ) {[br] jQuery('#lat').val(json.lat);[mark]//SET SECOND HIDDEN VALUE [/mark][br] jQuery('#lng').val(json.lng);[mark]//SET THIRD HIDDEN VALUE [/mark][br] }).fail(function (jqXHR, textStatus,errorThrown) {[br] alert("Errore"+textStatus+"--> status: "+jqXHR.status+ "\nerrorThrown: " + errorThrown);[br] });[br]}[/pre][br]In V6, I have my checkbox , I should set an event on Checked , under Events, and create the event under Setup and put this JS code with custom Code...but i can add only php code. [br]How can i do in V6?[br]These 3 hidden fields must be inserted into a table together with the other fields of the form[br][br]PS if is possible, this logic js could be added also when the form was submitted...i hope u can help me[br][br]regards[br]Daniele[br]
i have a problem with chronoforms V6. In V5, i have 3 hidden fields populate as follow:
1) i have a check box with event "Check" that call a function, called "getdata".
2) Under Setup, "On Load", i have a "load javascript" action with the code:[pre]function getdata(){
var indirizzo = document.getElementById("indirizzo").value;
var comune = document.getElementById("comune").value;
var nome = document.getElementById("nome").value;
link = link.concat(comune,'/',nome);
document.getElementById("link").value=link; [mark]//SET FIRST HIDDEN VALUE [/mark]
var postData = {
"indirizzo" : indirizzo,[br] "comune" : comune[br] };[br][br] jQuery.ajax({[br] url: "/getCoordinatesFromAddress.php"[br] ,data: postData[br] ,type: "POST"[br] ,contentType: "application/json"[br] ,dataType : "json"[br] }).done(function( json ) {[br] jQuery('#lat').val(json.lat);[mark]//SET SECOND HIDDEN VALUE [/mark][br] jQuery('#lng').val(json.lng);[mark]//SET THIRD HIDDEN VALUE [/mark][br] }).fail(function (jqXHR, textStatus,errorThrown) {[br] alert("Errore"+textStatus+"--> status: "+jqXHR.status+ "\nerrorThrown: " + errorThrown);[br] });[br]}[/pre][br]In V6, I have my checkbox , I should set an event on Checked , under Events, and create the event under Setup and put this JS code with custom Code...but i can add only php code. [br]How can i do in V6?[br]These 3 hidden fields must be inserted into a table together with the other fields of the form[br][br]PS if is possible, this logic js could be added also when the form was submitted...i hope u can help me[br][br]regards[br]Daniele[br]