Skip to content
Snippets Groups Projects
Commit 9d93d25b authored by Rhys Evans's avatar Rhys Evans
Browse files

Added 4 basic locations associated with the Penarth and Risca trails listed in...

Added 4 basic locations associated with the Penarth and Risca trails listed in the landamrk submission form. Moved said forms javascript to a seperate file
parent bd9eb068
No related branches found
No related tags found
1 merge request!23Resolve "As a developer I want all landmarks to be stored together"
......@@ -25,3 +25,10 @@ insert into locations (locationID, locationName , locationEmail,locationDescript
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (14, 'The Medieval Courthouse','','Location description here','Caerphilly',0103);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (15 ,'Caerphilly Castle','','Location description here','Caerphilly',0103);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (16, 'Ty Vaughan House','','Location description here','Caerphilly',0103);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (17, 'Risca Colliery','','Location description here','Risca',0201);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (18, 'Black Vein Colliery Disaster','','Location description here','Risca',0201);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (19, 'The Esplanade','','Location description here','Penarth',0301);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value (20, 'The Old Swimming Baths','','Location description here','Penarth',0301);
// verification function of the above form
function landmarkFormValidation(){
var pass=true;
var trail = document.forms["landmarkSubmission"]["trailID"].value
var location = document.forms["landmarkSubmission"]["landmarkLocation"].value
var description = document.forms["landmarkSubmission"]["landmarkDescription"].value;
var descriptionWrdCount=description.split(" ").length
if (descriptionWrdCount>200){
alert('Please keep your description to a maximum of 200 words.');
pass = false;
}
if (trail==0){ // values of 0 and "" used to ensure default drop down option isn't submittable
alert('Invalid trail selected. \nPlease select the trail you wish to join.');
pass = false;
}
if (location==""){
alert('Invalid location selected. \nPlease select the location you wish to join.');
pass = false; // ensure correct trail is selected in accordance to the town it takes place in
} if ( (location=="Caerphilly" & (parseInt(trail/100)!==1)) ||
(location=="Risca" & (parseInt(trail/100)!==2)) ||
(location=="Penarth" & (parseInt(trail/100)!==3)) ){
alert('Trail unavailable in your current location. \nPlease choose an available trail');
pass = false;
}
return pass;
}
......@@ -5,6 +5,9 @@
<title>Landmark Sign Up</title>
<link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}">
<link rel="stylesheet" th:href="@{css/templatingstyle.css}">
<!-- <link rel="script" th:href="@{scripts/landmarkFormThScript.js}">-->
<script src="scripts/landmarkFormThScript.js"></script>
<!-- <style in="scripts/landmarkFormThScript.js"></style>-->
</head>
......@@ -58,45 +61,7 @@
<hr style="height:40px; visibility:hidden;" />
</main>
<script>
// verification function of the above form
function landmarkFormValidation(){
var pass=true;
var trail = document.forms["landmarkSubmission"]["trailID"].value
var location = document.forms["landmarkSubmission"]["landmarkLocation"].value
var description = document.forms["landmarkSubmission"]["landmarkDescription"].value;
var descriptionWrdCount=description.split(" ").length
if (descriptionWrdCount>200){
alert('Please keep your description to a maximum of 200 words.');
pass = false;
}
if (trail==0){ // values of 0 and "" used to ensure default drop down option isn't submittable
alert('Invalid trail selected. \nPlease select the trail you wish to join.');
pass = false;
}
if (location==""){
alert('Invalid location selected. \nPlease select the location you wish to join.');
pass = false; // ensure correct trail is selected in accordance to the town it takes place in
} if ( (location=="Caerphilly" & (parseInt(trail/100)!==1)) ||
(location=="Risca" & (parseInt(trail/100)!==2)) ||
(location=="Penarth" & (parseInt(trail/100)!==3)) ){
alert('Trail unavailable in your current location. \nPlease choose an available trail');
pass = false;
}
return pass;
}
</script>
<footer th:insert="~{/towns/Templating.html :: footer}"></footer>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment