Darkness4869

Register.js

Apr 13th, 2021
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Importing Show Form function
  2. import { showForm, requestServerAttention } from "./RegisterMain.js";
  3. // Storing JSX Variables
  4. const left = React.createElement("img", { src: "../Images/Education.png" });
  5. const formButtons = [
  6.     React.createElement(
  7.         "div",
  8.         { id: "student" },
  9.         React.createElement(
  10.             "button",
  11.             {
  12.                 id: "studentFormButton",
  13.                 onClick: () => {
  14.                     showForm(this.id);
  15.                 },
  16.             },
  17.             "Student"
  18.         )
  19.     ),
  20.     React.createElement(
  21.         "div",
  22.         { id: "staff" },
  23.         React.createElement(
  24.             "button",
  25.             {
  26.                 id: "staffFormButton",
  27.                 onClick: () => {
  28.                     showForm(this.id);
  29.                 },
  30.             },
  31.             "Staff"
  32.         )
  33.     ),
  34. ];
  35. const studentRegistrationForm = React.createElement(
  36.     "form",
  37.     { method: "post" },
  38.     React.createElement("input", {
  39.         type: "email",
  40.         name: "mailAddress",
  41.         id: "mailAddress",
  42.         placeholder: "Mail Address",
  43.         attribute: "required",
  44.     }),
  45.     React.createElement(
  46.         "div",
  47.         { id: "mailAddressNotice" },
  48.         "You need to use your UDM Mail to register into this system."
  49.     ),
  50.     React.createElement("input", {
  51.         type: "text",
  52.         name: "studentId",
  53.         id: "studentId",
  54.         placeholder: "Student ID",
  55.     }),
  56.     React.createElement(
  57.         "div",
  58.         { id: "studentIdNotice" },
  59.         "You need to use either your NTA bus pass or your UDM Student ID to register into the system."
  60.     ),
  61.     React.createElement("input", {
  62.         type: "submit",
  63.         value: "Register",
  64.         id: "registerButton",
  65.         name: "register",
  66.         className: "student",
  67.         onClick: () => {
  68.             requestServerAttention(this.className);
  69.         },
  70.     })
  71. );
  72. const staffRegistrationForm = React.createElement(
  73.     "form",
  74.     { method: "post" },
  75.     React.createElement("input", {
  76.         type: "email",
  77.         name: "mailAddress",
  78.         id: "mailAddress",
  79.         placeholder: "Mail Address",
  80.         attribute: "required",
  81.     }),
  82.     React.createElement(
  83.         "div",
  84.         { id: "mailAddressNotice" },
  85.         "You need to use your UDM Mail to register into this system."
  86.     ),
  87.     React.createElement("label", { for: "type" }, "Staff's Type:"),
  88.     React.createElement(
  89.         "select",
  90.         {
  91.             name: "type",
  92.             id: "type",
  93.             attribute: "required",
  94.         },
  95.         React.createElement("option", { value: "" }),
  96.         React.createElement("option", { value: "academics" }, "Academics"),
  97.         React.createElement(
  98.             "option",
  99.             { value: "non-academics" },
  100.             "Non-Academics"
  101.         )
  102.     ),
  103.     React.createElement(
  104.         "div",
  105.         { id: "typeNotice" },
  106.         "You need to choose according to the role that you occupy in the organization."
  107.     ),
  108.     React.createElement("input", {
  109.         type: "submit",
  110.         value: "Register",
  111.         id: "registerButton",
  112.         className: "staff",
  113.         name: "register",
  114.         onClick: () => {
  115.             requestServerAttention(this.className);
  116.         },
  117.     })
  118. );
  119. // Rendering Register page
  120. ReactDOM.render(left, document.getElementById("left"));
  121. ReactDOM.render(formButtons, document.getElementById("formButtons"));
  122. ReactDOM.render(
  123.     studentRegistrationForm,
  124.     document.getElementById("studentRegistrationForm")
  125. );
  126. ReactDOM.render(
  127.     staffRegistrationForm,
  128.     document.getElementById("staffRegistrationForm")
  129. );
  130.  
Advertisement
Add Comment
Please, Sign In to add comment