jquery - Coldfusion/Javascript if checkbox is checked -
i utilize help on one. modifying elses code. bassically script loops through info via coldfusion. user suppose insert info each of these looped items. 1 time completed javascript box pops , confirms info user has entered correct. works fine... part having problem need check box next each looped form click select looped form want submit. i've gotten coldfusion part work easily.. however, need verification box verify forms have been checked.
confirmation box varibles exaple
<cfset variables["promptmessage" & currentrow] = variables["promptmessage" & currentrow] & "<br /><br /><strong>lease:</strong> "> <cfset variables["promptmessage" & currentrow] = variables["promptmessage" & currentrow] & "l. hrs: <strong style=""color:black"">' + $('##le_lefh#currentrow#').val() + '</strong>"> <cfset variables["promptmessage" & currentrow] = variables["promptmessage" & currentrow] & " | l. cycles: <strong style=""color:black"">' + $('##le_lcycles#currentrow#').val() + '</strong>"> <cfset variables["promptmessage" & currentrow] = variables["promptmessage" & currentrow] & " | r. hrs: <strong style=""color:black"">' + $('##le_refh#currentrow#').val() + '</strong>"> <cfset variables["promptmessage" & currentrow] = variables["promptmessage" & currentrow] & " | l. cycles: <strong style=""color:black"">' + $('##le_rcycles#currentrow#').val() + '</strong>"> <cfset variables["promptmessage" & currentrow] = variables["promptmessage" & currentrow] & "<br /><br />">
checkbox example
<div style="color:##ff0000;background-color:;background-color:##dadada;border-left:1px solid ##999;border-right:1px solid ##999;border-bottom:1px solid ##999;"><input type="checkbox" name="confirm#currentrow#" value="1"> <strong>select study engine usage aircraft.</strong></div></div>
the confirmation box action code.
<script type="text/javascript"> $(document).ready(function(){ // grab submit $("##btn_submit").click(function(e){ jconfirm('<strong>confirm engine usage information. click confirm proceed or edit edit values.</strong><cfloop from="1" to="10" index="x">#variables["promptmessage" & x]#</cfloop><br />', 'report confirmation dialog', function(r) { // if confirmed, manually trigger form submission if (r) $("##btn_submit").parents("form").submit(); }); // homecoming false here since don't know jconfirm going homecoming false; }); }); $(document).ready(function() { var $dialog = $('<div></div>') .html('this dialog show every time!') .dialog({ autoopen: false, title: 'basic dialog', modal: true, height: 400, buttons: { "delete items": function() { $( ).dialog( "close" ); }, cancel: function() { $( ).dialog( "close" ); } } }); $('##popup').click(function() { $dialog.dialog('open'); // prevent default action, e.g., next link homecoming false; }); }); </script>
just maintain in mind it's looping thorugh query.
i suggest redesign form. instead of marrying row number of query, marry them id field of record. they'll easier work way.
the checkboxes easier work if have same name different values. this:
<cfoutput query="somequery"> <input type="checkbox" name="processme" value="#id#"> </cfoutput>
then, when process form can simple loop.
<cfif structkeyexists(form, "processme")> <cfloop list = "#form.processme#" index="thisid"> code closing tags
javascript jquery coldfusion
No comments:
Post a Comment