************************************************************************************ ******************* MODERATION CODE - ADDED BY ADMIN/DEVELOPER ******************* ************************************************************************************ 20 March 2012 COMPLETED NOTE - this code uses show/hide instructions controls as moderation instructions fit into the same requirements ***********MODERATION TEXT CODE 1: PARSING THE URL TO DETERMINE WHAT STAGE THE SIGHTING RECORD IS AT THEN SETTING APPROPRIATE DEISPLAY ATTRIBUTES css display/hide settings are set to default values on load for all page content the pageMode variable is then used to determine whether to show or hide instructions & other fields on page load by overriding the default settings. .instructions controls display of the class="instructions" - used wherever there is instruction text .moderation controls display of the class="moderation" - used for the moderation instructions (wrapped in instructions class) ate foot of the page - requires the moderatorComments comments field and the modCommsDisplay field (both immediately following this section. #addSpecies in the field instr_add_species controls display of the add species intructions id="addSpecies" used when Not Listed is selected attribute 417 is the species to be added field and its label - they are assigned to a field when it is created in the form buoild: RH mouse click in browser to see & adjust your code appropriately. the for= is the label attribute, the other the field itself. $('label[for="attribute_417"]').parents('tr').hide(); using this instead hides the enter row and deals with the Read case where the prposed name is in an unnamed span. in Production it is attribute 372 attribute 422 is the moderation comments field and its label - in UAT in Production it is 365 --------------COPY CODE START -------------- --------------COPY CODE END -------------- ***********MODERATION TEXT CODE 2: Moderation comments field - has attribute 422: Description = Moderators Comments; Database Name = moderatorComments; type = Long Text at survey level. Displaying the Admin moderation comments & label using divs - CSS is set on load by code above --------------COPY CODE START --------------
--------------COPY CODE END -------------- ***********MODERATION CODE 3 - UPDATE TO SPECIES IDENTIFICATION AUTCOMPLETE FIELD: WHEN = "NOT LISTED" ADDS FIELD & INSTRUCTIONS TO FORM FOR USER TO INDETIFY MISSING SPECIES NAME WORKING CODE This code manages display for record where the species field is being EDITED - new & moderated records Instructions - copy the code below and paste into the HTML field you wish to hide - suggest using a field name such as Not_Listed - this code tests the species autocomplete field and, if Uncertain (not used in ALCW) or Not Listed are selected displays the otherwise hidden add_species field and the associated instructions div class="addSpecies" - NOTE in production ALCW the species field is attribute_372 so need to replace on copying over AND find the attribute number/s when using elsewhere )I use firebug with FireFix to inspect the element and get the ID number --------------COPY CODE START -------------- --------------COPY CODE END --------------