[eluser]D R Upton[/eluser]
Thanks very much for the very quick reply.
Leaving aside where in my CI files the code is, what is being generated as the HTML page source code is now:
Code:
<head>
<meta name="robots" content="noindex,nofollow">
<s_cript type='text/javascript' src="http://127.0.0.1/sonof/js/jquery.js"></s_cript>
<s_cript type='text/javascript' src="http://127.0.0.1/sonof/js/jqcode.js"></s_cript>
<s_cript type='text/javascript' src="http://127.0.0.1/sonof/js/ui.core.js"></s_cript>
<s_cript type='text/javascript' src="http://127.0.0.1/sonof/js/ui.draggable.js"></s_cript>
<s_cript type='text/javascript' src="http://127.0.0.1/sonof/js/ui.droppable.js"></s_cript>
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/sonof//aw2.css">
<s_cript>
$(document).ready(function(){
$("button.save-risks").click(function() {
var riskLevels = ['unassigned','lowrisk','medrisk','highrisk'];
alert{'got here'};
// dynamically create a new form
var form = document.createElement('form');
form.style.display = 'none';
form.method = 'post';
form.action = 'http://127.0.0.1/sonof/index.php/start/assess/71/37/4/1.html' // whatever you want the form to submit to...
document.body.appendChild(form);
// populate our new form with data
for(var i = 0; i < riskLevels.length; i++) {
var riskLevel = riskLevels[i];
var selector = '.'+riskLevel+' .ui-draggable';
$(selector).each(function(el) {
var input = document.createElement('input');
input.name = riskLevel+'-entries[]';
input.value = el.html; //innerText might be a better idea
var htmlStr = $(this).html();
alert(htmlStr);
});
}
form.submit();
});
});
[removed]
</head>
<body>
//....page stuff and code setting up containers etc....
<INPUT TYPE='button' id='save-risks' class='save-risks' name='save-risks' value='click me3'>
</body>
</html>
(NB all those 's_cripts' are like that so the CI forum will show them, in the original it's the s-word without the underscore of course.)
Does this look OK to you?