Commit ecd00b12 authored by Hannes Warnestad's avatar Hannes Warnestad
Browse files

Fix

parent 6acdbb4c
This source diff could not be displayed because it is too large. You can view the blob instead.
<html><head><meta charset="utf-8"/><title>Kategori: Hållbara transporter</title><script src="form1.bundle.js"></script><header><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Hållbara transporter 1</h1></div></header></head><body><form-1></form-1><script src="form1.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Kategori: Hållbara transporter</title><script src="form1.bundle.js"></script><header><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Hållbara transporter 1</h1></div></header></head><body><form-1></form-1><script src="form1.bundle.js"></script></body></html>
\ No newline at end of file
This diff is collapsed.
<html><head><meta charset="utf-8"/><title>Kategori: Hållbara transporter</title><header><script src="form2.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Hållbara transporter 2</h1></div></header></head><body><form-2></form-2><script src="form2.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Kategori: Hållbara transporter</title><header><script src="form2.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Hållbara transporter 2</h1></div></header></head><body><form-2></form-2><script src="form2.bundle.js"></script></body></html>
\ No newline at end of file
This diff is collapsed.
<html><head><meta charset="utf-8"/><title>Kategori: Hälsomedvetenhet</title><header><script src="form3.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Hälsomedvetenhet 1</h1></div></header></head><body><form-3></form-3><script src="form3.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Kategori: Hälsomedvetenhet</title><header><script src="form3.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Hälsomedvetenhet 1</h1></div></header></head><body><form-3></form-3><script src="form3.bundle.js"></script></body></html>
\ No newline at end of file
This diff is collapsed.
<html><head><meta charset="utf-8"/><title>Kategori: Hälsomedvetenhet</title><header><script src="form4.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Hälsomedvetenhet 2</h1></div></header></head><body><form-4></form-4><script src="form4.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Kategori: Hälsomedvetenhet</title><header><script src="form4.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Hälsomedvetenhet 2</h1></div></header></head><body><form-4></form-4><script src="form4.bundle.js"></script></body></html>
\ No newline at end of file
This diff is collapsed.
<html><head><meta charset="utf-8"/><title>Kategori: Hållbar konsumtion</title><header><script src="form5.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Hållbar konsumtion 1</h1></div></header></head><body><form-5></form-5><script src="form5.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Kategori: Hållbar konsumtion</title><header><script src="form5.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Hållbar konsumtion 1</h1></div></header></head><body><form-5></form-5><script src="form5.bundle.js"></script></body></html>
\ No newline at end of file
This diff is collapsed.
<html><head><meta charset="utf-8"/><title>Kategori: Hållbar konsumtion</title><header><script src="form6.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Hållbar konsumtion 2</h1></div></header></head><body><form-6></form-6><script src="form6.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Kategori: Hållbar konsumtion</title><header><script src="form6.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Hållbar konsumtion 2</h1></div></header></head><body><form-6></form-6><script src="form6.bundle.js"></script></body></html>
\ No newline at end of file
<html><head><meta charset="utf-8"/><title>Resultat: Hållbara transporter</title><header><script src="form7.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Resultat: Hållbara transporter</h1></div></header></head><body><result-transport></result-transport><script src="form7.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Resultat: Hållbara transporter</title><header><script src="form7.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Resultat: Hållbara transporter</h1></div></header></head><body><result-transport></result-transport><script src="form7.bundle.js"></script></body></html>
\ No newline at end of file
<html><head><meta charset="utf-8"/><title>Resultat: Hälsomedvetenhet</title><header><script src="form8.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Resultat: Hälsomedvetenhet</h1></div></header></head><body><result-health></result-health><script src="form8.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Resultat: Hälsomedvetenhet</title><header><script src="form8.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Resultat: Hälsomedvetenhet</h1></div></header></head><body><result-health></result-health><script src="form8.bundle.js"></script></body></html>
\ No newline at end of file
<html><head><meta charset="utf-8"/><title>Resultat: Hållbar konsumtion</title><header><script src="form9.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;line-height: 100px;height: 100px;">Resultat: Hållbar konsumtion</h1></div></header></head><body><result-consumption></result-consumption><script src="form9.bundle.js"></script></body></html>
\ No newline at end of file
<html lang="sv"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Resultat: Hållbar konsumtion</title><header><script src="form9.bundle.js"></script><div style="height: 100px;width: 100%; position: relative; border-radius: 5px; background-color: #f64c4f;"><h1 style="text-align: center; color: white; vertical-align: middle;font-family:'Times New Roman';line-height: 100px;height: 100px;">Resultat: Hållbar konsumtion</h1></div></header></head><body><result-consumption></result-consumption><script src="form9.bundle.js"></script></body></html>
\ No newline at end of file
......@@ -6,22 +6,22 @@ class form1 extends formBase {
const allQuestionsInfo = [
{
title: "Vilket färdsätt använder du idag för att ta dig till jobbet?",
name: "commuteMethod",
name: "form11",
dataMethod: filterServiceData.form11
},
{
title: "Avstånd till jobbet?",
name: "commuteDistance",
name: "form12",
dataMethod: filterServiceData.form12
},
{
title: "Tid på dagen som du åker till jobbet?",
name: "commuteDepartureTime",
name: "form13",
dataMethod: filterServiceData.form13
},
{
title: "Hur ofta jobbar du hemma eller på annan plats än din arbetsplats",
name: "commuteOtherWorkplace",
name: "form14",
dataMethod: filterServiceData.form14
}
]
......
......@@ -48,22 +48,26 @@ class formBase extends WC {
template.appendChild(submit);
submit.addEventListener("click", () => {
this.getData();
let cont = true;
let selectedIndexes = [];
rbArr.forEach(el => {
//console.log(el.radioButtons)
let foundChecked = false;
let i = 0;
el.radioButtons.forEach(rb => {
if (rb.button.checked)
if (rb.button.checked) {
foundChecked = true;
selectedIndexes.push(i);
}
i++;
})
if (!foundChecked)
cont = false;
})
console.log(cont)
if (!cont)
window.alert("Alla frågor är inte ifyllda. Var god fyll i alla.")
else {
this.getData(rbArr, selectedIndexes);
writeToServer("")
.then(() => {
window.alert("Ditt svar är nu inskickat! Du kan nu stänga sidan.")
......@@ -76,14 +80,28 @@ class formBase extends WC {
}
getData(){
//console.log(com.rplp.mypackage.testSum(1,2))
getData(rbArr, selectedIndexes) {
//console.log(com.rplp.mypackage.testSum(1,2))
// var user = new package.com.rplp.mypackage.User;
user.id = 1;
console.log(user.id)
let jsonUser = {
questions: [
]
}
for (let i = 0; i < rbArr.length; i++) {
jsonUser.questions.push({
form: rbArr[i].getAttribute("name"),
value: selectedIndexes[i]
})
}
console.log(jsonUser)
return "Hello";
}
}
......
No preview for this file type
#Generated by Maven
#Thu Nov 19 15:11:15 CET 2020
#Thu Nov 19 16:45:32 CET 2020
groupId=com.rplp.forms
artifactId=rplp-forms
version=1.0.0
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment