Changes

Jump to: navigation, search

Family Management

1,042 bytes added, 13:48, 22 March 2018
→‎Family_Ident field
The following page fragment will add the family_ident field to the "Modify Info" screen along with a link to assign the next available Family ID when needed.
<pre>
<!-- create a hidden table with added rows, use jQuery to move the inserted rows to target table -->
<table id="familyidhiddentable" style="display: none;">
<tr id="familyidrow">
<td class="bold">Family ID</td>
<td><input type="text" id="familyidfield" name="[Students]Family_Ident" value="">
<a href="javascript:void(0)" id="usenextfamilyid"><strong>Copy next available Family ID: <span id="nextfamilyidval">~[tlist_sql;select max(family_ident)+1 from students]~(maxFamilyID;t)[/tlist_sql]</span></strong>
</td>
</tr>
</table>
<script>
$j(function() {
/* place the family id row at the beginning of the table */
$j("table:first").prepend($j("#familyidrow"));
 
/* remove the hidden table */
$j("#familyidhiddentable").remove();
 
/* Function to add click listener to copy the next available ID */
$j("#usenextfamilyid").click(function() {
if($j("#familyidfield").val() == "") {
$j("#familyidfield").val( $j("#nextfamilyidval").html() );
}
});
 
});
</script>
</pre>
[[Category:Contents]]

Navigation menu