
I need 3 problems fixed in Javascript and Html files as described
- or -
Post a project like this4171
£20(approx. $27)
- Posted:
- Proposals: 4
- Remote
- #535970
- Awarded
Description
Experience Level: Entry
Estimated project duration: 1 day or less
General information for the website: Fix the .html (attached) and .js files (one attached the other copied in) as described
Kind of development: Customization of existing website
Description of every page/module: Here is the job spec:
NB: I you cannot deliver before midnight, please don't take the job.
r.html calling r2.js and contactform.html calling contactform.js.
r2.js should also call contactform.html and only when necessary (x>25) display the contactform below all messages generated by rs.js
File r.html call r2.js
r2.js calculates values based on the radio butoons clicked in the r.html:
When the Calculate button is clicked, the r2.js file calculates the healthrisk based on the radio buttons clicked.
The radio buttons clicked, results in values of the radio buttons added.
There are 3 messages displayed, depending on which radio buttons are clikced.
If the radio buttons calculate a value > 25, then additional messages also appear explaining the risk of the user.
Problem 1:
The calculations work, but there is a change to be made:
The error messages appear below the calculation click button.
Then an alerts message appears.
I want the messages to stay on the screen, but WITHOUT the need for the alert box.
My problem is, that if I remove the code to display the alert box, then the messages Calculate button disappears.
Problem 2:
If the calculation results in a value > 25,
then,
below the messages all the messages that currently are shown,
an input form must appear below the messages:
Ie the script in r2.js or r.html must bring contactform.html onto the screen below the r.html form and below the messages that at that stage will be below the Calculate button
(This second form is in Contactform.html )
Problem 3:
In Contactform.html there are validations in contactform.js that validates user input.
The error messages must appear not in the alert box as I have it, but on the screen next to the input box that is causing the problem.
eg :
First Name : _____Text Box ___________ * First name cannot be blank
Can you please update the files to fix the 3 problems?
Thank you!
Extra notes: Here is ContactForm.js
function checkForm() {
document.getElementById("contactform").onsubmit = function() {
var allowsubmit = true;
document.getElementById("qmark").onmouseover = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="block";
}
document.getElementById("qmark").onmouseout = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="none";
}
if(document.getElementById("txt1").value === ""){
alert("First Name Field Cannot be Blank");
}
if(document.getElementById("txt2").value === ""){
alert("Last Name Field Cannot be Blank");
}
var healthnr = document.getElementsByName("txt3").value;
if(document.getElementById("txt3").value === ""){
alert("Health authority no field cannot be Blank");
/*if (healthnr.length == 9) {
if ((healthnr.substr(1,3)) == "ZHA"){
if (isNaN(healthnr.substr(4,6))) {
alert("last 6 not numeric");
}else{
alert ("number ok");
}
}//close zha
}//close length */
allowsubmit = false;
}
var email = document.getElementById('Email');
//Expression for checking email
var emailExpression = /[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}/;
if (!emailExpression.test(email.value)) {
alert("Please enter valid email");
return false;
}
if (allowsubmit) {
}
return allowsubmit;
//Tooltip
function tooltip() {
document.getElementById("qmark").onmouseover = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="block";
}
document.getElementById("qmark").onmouseout = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="none";
}
}
}
}
window.onload=checkForm;
Kind of development: Customization of existing website
Description of every page/module: Here is the job spec:
NB: I you cannot deliver before midnight, please don't take the job.
r.html calling r2.js and contactform.html calling contactform.js.
r2.js should also call contactform.html and only when necessary (x>25) display the contactform below all messages generated by rs.js
File r.html call r2.js
r2.js calculates values based on the radio butoons clicked in the r.html:
When the Calculate button is clicked, the r2.js file calculates the healthrisk based on the radio buttons clicked.
The radio buttons clicked, results in values of the radio buttons added.
There are 3 messages displayed, depending on which radio buttons are clikced.
If the radio buttons calculate a value > 25, then additional messages also appear explaining the risk of the user.
Problem 1:
The calculations work, but there is a change to be made:
The error messages appear below the calculation click button.
Then an alerts message appears.
I want the messages to stay on the screen, but WITHOUT the need for the alert box.
My problem is, that if I remove the code to display the alert box, then the messages Calculate button disappears.
Problem 2:
If the calculation results in a value > 25,
then,
below the messages all the messages that currently are shown,
an input form must appear below the messages:
Ie the script in r2.js or r.html must bring contactform.html onto the screen below the r.html form and below the messages that at that stage will be below the Calculate button
(This second form is in Contactform.html )
Problem 3:
In Contactform.html there are validations in contactform.js that validates user input.
The error messages must appear not in the alert box as I have it, but on the screen next to the input box that is causing the problem.
eg :
First Name : _____Text Box ___________ * First name cannot be blank
Can you please update the files to fix the 3 problems?
Thank you!
Extra notes: Here is ContactForm.js
function checkForm() {
document.getElementById("contactform").onsubmit = function() {
var allowsubmit = true;
document.getElementById("qmark").onmouseover = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="block";
}
document.getElementById("qmark").onmouseout = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="none";
}
if(document.getElementById("txt1").value === ""){
alert("First Name Field Cannot be Blank");
}
if(document.getElementById("txt2").value === ""){
alert("Last Name Field Cannot be Blank");
}
var healthnr = document.getElementsByName("txt3").value;
if(document.getElementById("txt3").value === ""){
alert("Health authority no field cannot be Blank");
/*if (healthnr.length == 9) {
if ((healthnr.substr(1,3)) == "ZHA"){
if (isNaN(healthnr.substr(4,6))) {
alert("last 6 not numeric");
}else{
alert ("number ok");
}
}//close zha
}//close length */
allowsubmit = false;
}
var email = document.getElementById('Email');
//Expression for checking email
var emailExpression = /[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}/;
if (!emailExpression.test(email.value)) {
alert("Please enter valid email");
return false;
}
if (allowsubmit) {
}
return allowsubmit;
//Tooltip
function tooltip() {
document.getElementById("qmark").onmouseover = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="block";
}
document.getElementById("qmark").onmouseout = function() {
var tooltipbg = document.getElementById("tooltip");
tooltipbg.style.display="none";
}
}
}
}
window.onload=checkForm;
Sara B.
99% (151)Projects Completed
151
Freelancers worked with
105
Projects awarded
33%
Last project
23 Dec 2025
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies