Sandbox:CourseSignup

From OpenWetWare
Jump to navigationJump to search

<html> <html> <script language="javascript"> <!-- var initial_count = new Array(); var rows_limit = 0; // Set to 0 to disable limitation

function addRow(table_id){

 var tbl = document.getElementById(table_id);
 // counting rows in table
 var rows_count = tbl.rows.length;
 if (initial_count[table_id] == undefined){
   // if it is first adding in this table setting initial rows count
   initial_count[table_id] = rows_count;
 }
 // determining real count of added fields
 var tFieldsNum =  rows_count - initial_count[table_id];
 if (rows_limit!=0){
     if (tFieldsNum >= rows_limit)
         return false;
 }
 var text = "Name:<br />Email:";
 var input = "<input type=\"text\" name=\"member[]\" " +
     "style=\"width:100%;\"/><input type=\"text\" name=\"email[]\" " +
     "style=\"width:100%;\"/>";
 var remove= "<input type=\"button\" value=\"X\" " +
     "onclick=\"removeRow('+table_id+',this.parentNode.parentNode)\" " +
     "style=\"width:100%;\"/>";
 try {
   var newRow = tbl.insertRow(rows_count);
   var newCell = newRow.insertCell(0);
   newCell.innerHTML = text;
   var newCell = newRow.insertCell(1);
   newCell.innerHTML = input;
   var newCell = newRow.insertCell(2);
   newCell.innerHTML = remove;
 } catch (ex) {
   //if exception occurs
   alert(ex);
 }

}

function removeRow(tbl,row){

 var table = document.getElementById(tbl);
 try {
   table.deleteRow(row.rowIndex);
 } catch (ex) {
   alert(ex);
 }

}

function EntryCheck(){ if (document.groupregister.university.value == '') { alert('Please specify a University/Institute name for your course.'); document.groupregister.university.focus(); return false; } if (document.groupregister.university.value.length > 100) { alert('University/Institute name must not exceed 100 characters.'); document.groupregister.university.focus(); return false; } if (document.groupregister.lab.value == '') { alert('Please specify a Course Number for your group.'); document.groupregister.lab.focus(); return false; } if (document.groupregister.lab.value.length > 100) { alert('Lab/Course/Team name must not exceed 100 characters.'); document.groupregister.lab.focus(); return false; } if (document.groupregister.reason.value.length > 255) { alert('Reason for creating group must not exceed 255 characters.'); document.groupregister.reason.focus(); return false; } if (document.groupregister.school.value.length > 100) { alert('Reason for creating group must not exceed 100 characters.'); document.groupregister.school.focus(); return false; } if (document.groupregister.note.value.length > 255) { alert('Note must not exceed 255 characters.'); document.groupregister.note.focus(); return false; } if (document.groupregister.comment.value.length > 255) { alert('Comment must not exceed 255 characters.'); document.groupregister.comment.focus(); return false; } if (document.getElementById('member') == undefined){ alert('You must specify at least 1 lab member.'); document.getElementById('mytable').focus(); return false; } return true; }

// --> </script> <div id="form_body" style="display:none" class="forms_body"> <form action="/um/um_process_group.php" name="groupregister"

   id="OneClick" onsubmit="return EntryCheck();" method="POST">

<table class="forms_table" width="100%" border="0" cellpadding="5" cellspacing="0">

 <tr id='TypeRow'>
   <td class="forms_style2">
     <span class="forms_label">
       Type of Group:
     </span>
   </td>
   <td valign="top" align="left">
     <span class="forms_style1">
     <select class="forms_format" name="type" id="type" />
         <option value="Lab">Research Lab</option>
         <option value="Course">Academic Course</option>
         <option value="IGEM">IGEM Team</option>
     </select><br />
     Please enter the group you would like to register.<br />
     <b>Lab:</b> Register the members of your lab.<br />
     <b>Course:</b> Register the students in your lab course.<br />
     <b>IGEM:</b> Register the members of an IGEM team.
     </span>
   </td>
 </tr>
 <tr id='UniversityRow'>
   <td class="forms_style2">
     <span class="forms_label">
       University/Institution:
     </span>
   </td>
   <td valign="top" align="left">
     <span class="forms_style1">
     <input type="text" size="30" class="forms_format" name="university" id="university" /><br />
     Please enter the name of your university, college or institutional affiliation.<br />
     This does not have to be unique. Multiple labs can be affiliated with one institution.<br />
     <b>Example</b>: MIT<br />
     </span>
   </td>
 </tr>
 <tr id='SchoolRow'>
   <td class="forms_style2">
     <span class="forms_label">
       School or Division:
     </span>
   </td>
   <td valign="top" align="left">
     <span class="forms_style1">
     <input type="text" size="30" class="forms_format" name="school" id="school" /><br />
     (Optional)<br />
     Please enter the name of your school or division.<br />
     This should be part of the University or Institution entered above.<br />
     This name does not have to be unique. Multiple labs can be affiliated with one school within an institution.<br />
     <b>Example</b>: Dept. of Biological Engineering<br />
     </span>
   </td>
 </tr>
 <tr id='ReasonRow'>
   <td class="forms_style2">
     <span class="forms_label">
       Reason:
     </span>
   </td>
   <td valign="top" align="left">
     <span class="forms_style1">
     <input type="text" size="30" class="forms_format" name="reason" id="reason" /><br />
     (Optional)<br />
     Each group member will be processed as a standard OWW applicant.<br />
     Please enter the text you would like to see entered for the "reason for joining" OWW.<br />
     This text will appear on all applications in addition to the one specified when you applied to OWW.<br />
     <b>Example</b>: BE 10.10 Lab Section<br />
     </span>
   </td>
 </tr>
 <tr id='LabRow'>
   <td class="forms_style2">
     <span class="forms_label">
       Lab/Class/Team Name:
     </span>
   </td>
   <td valign="top" align="left">
     <span class="forms_style1">
     <input type="text" size="30" class="forms_format" name="lab" id="lab"/><br />
     Please enter the name of your lab, course, or team.<br />
     This name will be used as the 'root' of all pages and notebooks related to your lab or course.<br/>
     Lab names must be unique within OpenWetWare.<br />
     <b>Example</b>: Brox Lab<br />
     </span>
   </td>
 </tr>
 <tr id='LabMembersRow'>
   <td class="forms_style2">
     <span class="forms_label">
       Lab Members:
     </span>
   </td>
   <td valign="top" align="left">
     <table cellspacing="0" cellpadding="4" id="mytable">
       <tr><th colspan="3"><input type="button" name="Button"
           value="Add a lab member" onClick="addRow('mytable')"></th></tr>
     </table>
     <span class="forms_style1"><br />
     Please enter the names and email addresses of the members of your Lab.<br />
     Click on the "Add a lab member" button above to add the name/email fields items for each member of your group.
     Each of these members will be connected by OWW to your lab.<br />
     Their names, email addresses as well as the affiliation and reasons for your joining OpenWetWare will be used
     to validate each of the lab members.<br />
     <b>Example</b>: Name: James Smith<br />
     <b>Example</b>: jmith@foo.bar<br />    
     </span>
   </td>
 </tr>
 <tr id='NoteRow'>
   <td class="forms_style2">
     <span class="forms_label">
       Message to New Lab/Course Members:
     </span>
   </td>
   <td valign="top" align="left">
     <span class="forms_style1">
     <textarea rows="5" cols="15"
             class="forms_format" id="note"
             name="note"></textarea><br />
     (Optional)<br />
     Enter a message you would like to have included in the Welcome messages sent out upon approval of each member's OWW account.<br />
     <b>Example</b>: This is the OWW account you will use for BE 10.10. Please contact me with any questions or comments. Dr. Brox<br />
     </span>
   </td>
 </tr>
 <tr id='NoteRow'>
   <td class="forms_style2">
     <span class="forms_label">
       Comment:
     </span>
   </td>
   <td valign="top" align="left">
     <span class="forms_style1">
     <textarea rows="5" cols="15"
             class="forms_format" id="comment"
             name="comment"></textarea><br />
     (Optional)<br />
     Please enter any addition comments you may have.<br />
     This will not appear in your OWW information but will be displayed to OWW admins reviewing your account.<br />
     <b>Example</b>: This application is for my first OWW course. Please contact me if this isn't complete!<br />
     </span>
   </td>
 </tr>
 <tr>
   <td align="left">&nbsp;</td>
   <td align="left">
     <input type="submit" class="forms_button" name="submit" value="Submit!" />
   </td>
 </tr>

</table> </form> </div>

<script language="JavaScript"> if (wgUserName.length == 0){

   document.getElementById('form_body').style.display="none";

}else{

   document.getElementById('form_body').style.display="inline";

} </script>

</html>