Hi @cyberdave,
Yes, I think I’m a little bit over the top with those form at the moment but the possibilities Weblfow has to offer, is just so exciting ! I’ve been learning so much the last few days thanks to the community.
I did have a look at your stackoverflow link, really interesting this prop attribute. I tried to implement it in a simplified version of my form, but need to understand / find a way how to connect that script instructions to the actual submit button.
Maybe something like that ?
var form = document.getElementById("form-id");
document.getElementById("your-id").addEventListener("click", function () {
form.submit();
});
I found some really interesting informatino about that prop attribute on the jquery help page but still missing the part where the “insider checkbox” (within the form) populates the value it got from the “outsider checkbox” which is outside - obviously - the form
I also thought of using the HTML5 “form” attribute which lets us reference an input field that is outside of a form tag like so:
<form id="myForm .... >
<input type="submit" />
</form>
<input type="text" form="myForm" />
But I read that alternative has its limitation, with internet explorer for example… kind of sad
Edit:
I also found this article on how to get the value of checked checkboxes.
Or this javascript article explaing how to get checkboxes’values.
For modern browser:
var checkedValue = document.querySelector('.outsider:checked').value;
By using jQuery:
var checkedValue = $('.outsider:checked').val();
Pure javascript:
var checkedValue = null;
var inputElements = document.getElementsByClassName('outsider');
for(var i=0; inputElements[i]; ++i){
if(inputElements[i].checked){
checkedValue = inputElements[i].value;
break;
}
}
Another javascript:
Again, not sure how to link the function to my submit button
CheckboxHandler.isChecked = function (checkboxObj) {
return(checkboxObj.checked == true);
};