What's new

Help Pahelp naman html css js

Status
Not open for further replies.

Falln

Forum Veteran
Joined
Mar 16, 2016
Posts
1,883
Reaction
280
Points
742
Hindi pa totally gumagana at maayos yung codes pwede po pahelp ma fix to? Sa mga master jan baka pwede po patulong please.
1. Problem is sa grade calcu and temp converter hindi pa totally nag function dahil may mali pa. Grade calcu sa pag compute. Temp conv pag same unit cinonvert error nalabas is "no selected unit".
 
Last edited:
1. State your problem/objective
2. What's the error code.
3. Give us a snippet of code
4 (optional) Provide a screenshot

Next time construct your thread meaningfully, don't let us guess what's this thread is all about.
 
[CODE lang="html" title="grade calc"]<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="https://fonts.googleapis.com/css?family=Righteous&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css">
<style>

body {
background-image: url("Act3/img/grades.jpg");
background-position: center;
height: 500px;
font-size: 12px;
}

body, button, input {
font-family: 'Righteous', cursive;
font-weight: 700;
letter-spacing: 1.4px;
}

.background {
display: flex;
min-height: 100vh;
}

.container {
flex: 0 1 700px;
margin: auto;
padding: 10px;
}

.screen {
position: relative;
background: #3e3e3e;
border-radius: 15px;
}

.screen:after {
content: '';
display: block;
position: absolute;
top: 0;
left: 20px;
right: 20px;
bottom: 0;
border-radius: 15px;
box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
z-index: -1;
}

.screen-body {
display: flex;
}

.screen-body-item {
flex: 1;
padding: 50px;
}

.screen-body-item.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

}

.app-title {
display: flex;
/flex-direction: column;/
justify-content: center;
align-items: center;
color: #33d9b2;f;
font-size: 26px;
text-transform: uppercase;
border-left: 4px solid #218c74;
padding: 10px;
}

.app-form-group {
margin-bottom: 15px;
}

.app-form-group.buttons {
margin-bottom: 0;
text-align: right;
}

.app-form-control {
width: 100%;
padding: 10px 0;
background: none;
border: none;
border-bottom: 1px solid #666;
color: #ddd;
font-size: 14px;
text-transform: uppercase;
outline: none;
transition: border-color .2s;
}

.app-form-control::placeholder {
color: #FFF;
}

.app-form-control:focus {
border-bottom-color: #ddd;
}

.app-form-button {
background: none;
border: none;
color: #33d9b2;
font-size: 14px;
cursor: pointer;
outline: none;
text-transform: uppercase;
}

.app-form-button:hover {
color: #218c74;
}

.showdata{
text-align: center;
color: white;
font-size: 1.2rem;
padding-top: -10px;
padding-bottom: 10px;
}

</style>
</head>
<body>

<div class="background">
<div class="container">
<div class="screen">
<div class="screen-body">
<div class="screen-body-item left">
<div class="app-title">
<div class="animated infinite heartBeat">
Student <br> Grade <br>
</div>
</div>
</div>
<div class="screen-body-item">
<div class="app-form">
<div class="app-form-group">
<input type="text" class="app-form-control" placeholder="Activities" id="g">
</div>
<div class="app-form-group">
<input type="text" class="app-form-control" placeholder="exam" id="e">
</div>
<div class="app-form-group">
<input type="text" class="app-form-control" placeholder="recitation" id="r">
</div>
<div >
<input type="button" name="" value="Compute" class="app-form-button" onclick="getResult()">
</div>
<div >
<input type="reset" name="" value="reset" class="app-form-button">
</div>
</div>
</div>
<div class="app-form-group showdata">
<p id="result"></p>

</div>
</div>

<script>

function getResult()
{
g = document.getElementById("Activities").value;
e = document.getElementById("exam").value;
r = document.getElementById("recitation").value;
if(g>95 || g<65 || e>95 || e<65 || r>95 || r<65)
{
alert("Grade cannot be greater than 95 and less than 65")
}
else
{
g1 = 0.35*g
g2 = 0.40*e
g3 = 0.25*r
grade = g1+g2+g3
if(grade >=91 && grade <=95)
{
document.getElementById("result").innerHTML = "EXCELLENT";
}
else if(grade >=86 && grade <=90)
{
document.getElementById("result").innerHTML = "GOOD";
}
else if(grade >=80 && grade <=85)
{
document.getElementById("result").innerHTML = "FAIR";
}
else if(grade >75 && grade <=79)
{
document.getElementById("result").innerHTML = "POOR";
}
else if(grade <=74)
{
document.getElementById("result").innerHTML = "FAIL";
}


</script>

</body>
</html>[/CODE]
 

Attachments

Last edited:
Mali document.getElementById mo.

HTML:
<input type="text" class="app-form-control" placeholder="Activities" id="g">

<input  type="text"  class="app-form-control"   placeholder="exam" id="e">

<input  type="text"  class="app-form-control"   placeholder="recitation" id="r">

pero dito (Activities, Exam, Recitation) :

JavaScript:
g = document.getElementById("Activities").value;
 e = document.getElementById("exam").value;
 r = document.getElementById("recitation").value;
 
[XX='Impostor Syndrome, c: 1175218, m: 299786'][/XX]
Sir di ko po gets alin babaguhin dun sa html parehas lang naman po sinend mo sa code ko.

Yung sa JavaScript naman po is gagawin kong isa lang ung document.getElementbyId ganto ba?
document.getElementbyId("Activities, Exam, Recitation").value;
 
[XX='boszken, c: 1175522, m: 486612'][/XX]
check your id references magkaiba.
sa html mo ang linagay mo sa id ng inputs mo ('g', 'e', 'r')
pero sa js mo ang linagay mo ('Activities', 'exam', 'recitation)

it should be this way;
g = document.getElementById("g").value;
e = document.getElementById("e").value;
r = document.getElementById("r").value;
 
Lods. Simple lang yung error mo. Nageend of line siya sabi ni console. Bale kulang ka ng dalawang end brackets sa dulo ng code.

Check mo muna yung console sa susunod. Bestfriend mo yan lalo na kung may js code ka.
 

Attachments

Status
Not open for further replies.

Similar threads

Back
Top