Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 87 additions & 71 deletions Ex/2021-11-25/css/Ex2_solution.css
Original file line number Diff line number Diff line change
@@ -1,90 +1,106 @@
.err {
background: #ffe6ee;
.err {
background: #ffe6ee;
/*border: 1px solid #b1395f; */
}

.empty {
border: 1px solid #1f44eb;
.empty {
border: 1px solid #1f44eb;
}

div{
div {
/* Center the form on the page */
margin: 0 auto;
width: 450px;
/* Form outline */
padding: 1em;
}

div.emsg{
color: #c12020;
font-weight: bold;
div.emsg {
color: #c12020;
font-weight: bold;
padding: 0;
height: 1em;
}

form {
/* Center the form on the page */
margin: 0 auto;
width: 450px;
/* Form outline */
padding: 1em;
border: 1px solid #CCC;
border-radius: 1em;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
/*all li elements inside form and adjacent sibling li elements*/
form li + li {
margin-top: 1em;
}
label {
/* Uniform size & alignment */
display: inline-block;
width: 100px;
text-align: right;
}
input,
textarea {
/* To make sure that all text fields have the same font settings
/* Center the form on the page */
margin: 0 auto;
width: 450px;
/* Form outline */
padding: 1em;
border: 1px solid #ccc;
border-radius: 1em;
}

ul {
list-style: none;
padding: 0;
margin: 0;
}

/*all li elements inside form and adjacent sibling li elements*/
form li + li {
margin-top: 1em;
}

label {
/* Uniform size & alignment */
display: inline-block;
width: 100px;
text-align: right;
}

input,
textarea {
/* To make sure that all text fields have the same font settings
By default, textareas have a monospace font */
font: 1em sans-serif;
/* Uniform text field size */
width: 300px;
box-sizing: border-box;
/* Match form field borders */
border: 1px solid #999;
}
input:focus,
textarea:focus {
/* Additional highlight for focused elements */
border-color: #000;
}
textarea {
/* Align multiline text fields with their labels */
vertical-align: top;
/* Provide space to type some text */
height: 5em;
}
.button {
/* Align buttons with the text fields */
padding-left: 90px; /* same size as the label elements */
}
button {
/* This extra margin represent roughly the same space as the space
font: 1em sans-serif;

/* Uniform text field size */
width: 300px;
box-sizing: border-box;

/* Match form field borders */
border: 1px solid #999;
}

input:focus,
textarea:focus {
/* Additional highlight for focused elements */
border-color: #000;
}

textarea {
/* Align multiline text fields with their labels */
vertical-align: top;

/* Provide space to type some text */
height: 5em;
}

.button {
/* Align buttons with the text fields */
padding-left: 90px; /* same size as the label elements */
}

button {
/* This extra margin represent roughly the same space as the space
between the labels and their text fields */
margin-left: .5em;
}
margin-left: 0.5em;
}

#A {
border: solid black;
background-color: gray;
text-align: center;
}
#B {
border: solid black;
background-color: gray;
text-align: center;
}
#C {
border: solid black;
background-color: gray;
text-align: center;
}
77 changes: 25 additions & 52 deletions Ex/2021-11-25/formValidationOnSubmit.html
Original file line number Diff line number Diff line change
@@ -1,62 +1,35 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/Ex2_solution.css">
<script type = "text/javascript" src = "js/formValidationOnSubmit.js"></script>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/Ex2_solution.css" />
<script type="text/javascript" src="js/formValidationOnSubmit.js"></script>
<title>Student details</title>
</head>
<body dir="rtl" onload="initiateForm()">
<div>
<p>פרטי סטודנט</p>
</div>
<p>בדיקת חבילה</p>
</div>
<form onSubmit="return saveStudent()">
<ul>
<li>
<label for="fname">שם פרטי:</label>
<input type="text" id="fname" name="first_name" required>
<div id="fname_err" class="emsg"></div>
</li>
<li>
<label for="lname">שם משפחה:</label>
<input type="text" id="lname" name="last_name" required>
<div id="lname_err" class="emsg"></div>
</li>
<li>
<label for="birthDate">תאריך לידה:</label>
<input type="date" id="birthDate" name="birthDate" required>
<div id="birth_err" class="emsg"></div>
</li>
<li>
<label for="education">שנות לימוד:</label>
<input type="number" min=0 id="education" onfocusin="cleanEducationError()" name="education" required>
<div id="education_err" class="emsg"></div>
</li>
<li>
<label for="kids">מספר ילדים:</label>
<input type="number" id="kids" name="kids">
<div id="kids_err" class="emsg"></div>
</li>
<li>
<label for="mail">Email:</label>
<input type="email" id="mail" name="student_email" required>
<div id="email_err" class="emsg"></div>
</li>
<li>
<label for="msg">הודעה:</label>
<textarea id="msg" name="student_message"></textarea>
</li>
<li class="button">
<button type="submit" id="submitForm">שמור</button>
</li>
</ul>
</form>
<label>דקות:</label>
<input type="number" /><br /><br />
<label>sms:</label>
<input type="number" /><br /><br />
<label>giga:</label>
<input type="number" />
</form>
<div>
<ul>
<li>
<button onclick = "getStudentFromLocalStorage()">איחזור</button>
</li>
</ul>
</div>
<ul>
<li>
<button onclick="getStudentFromLocalStorage()">איחזור</button>
<button type="button">חשב</button>
</li>
</ul>
</div>
<div id="packages">
<div id="A">א</div>
<div id="B">ב</div>
<div id="C">ג</div>
</div>
</body>
</html>
</html>
3 changes: 3 additions & 0 deletions Ex/2021-11-25/js/formValidationOnSubmit.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#packages {
background-color: gray;
}
Loading