Cam the Ram Posted January 18, 2017 Share Posted January 18, 2017 My Grandmother had a fall over Christmas and broke her arm so it put a bit of a strain on my University studies as I had to devote most of my attention to her. So now I'm in a bit of a rush to get this work done and out the way but I'm struggling with getting my functions to work on my form. Any chance there's some smart ar*e on here who would be willing to help? Link to comment Share on other sites More sharing options...
eddie Posted January 18, 2017 Share Posted January 18, 2017 Are we talking Excel forms or HTML (or another vehicle?) Link to comment Share on other sites More sharing options...
Cam the Ram Posted January 18, 2017 Author Share Posted January 18, 2017 36 minutes ago, eddie said: Are we talking Excel forms or HTML (or another vehicle?) This particular one involves using JavaScript for the form, sending the results to a PHP page and then they send the results to be shown within a database. It's the JavaScript functions I'm having a few problems with, like this: function runner() { var runner = document.getElementById('RunnerID').value; if (runner.length == 0) { return false; alert("Please fill in mandatory fieldes"); } else { return ""; } } That just does nothing for me when I click submit on the form. Link to comment Share on other sites More sharing options...
Stive Pesley Posted January 18, 2017 Share Posted January 18, 2017 You tried any online parsers to validate the code? eg http://codebeautify.org/jsvalidate Link to comment Share on other sites More sharing options...
Cam the Ram Posted January 18, 2017 Author Share Posted January 18, 2017 17 minutes ago, StivePesley said: You tried any online parsers to validate the code? eg http://codebeautify.org/jsvalidate Yeah it returns saying this: Bit I don't recall studying much about strict statements and can't see why the others are wrong. Link to comment Share on other sites More sharing options...
Stive Pesley Posted January 18, 2017 Share Posted January 18, 2017 Most of those errors are with the formatting. If you move the expected locations then it validates better, but still leaves you with a few errors. Quote function document() { "use strict"; var runner = document.getElementById('RunnerID').value; if (runner.length === 0) { return false; alert("Please fill in mandatory fieldes"); } else { return ""; } } Link to comment Share on other sites More sharing options...
Cam the Ram Posted January 18, 2017 Author Share Posted January 18, 2017 9 minutes ago, StivePesley said: Most of those errors are with the formatting. If you move the expected locations then it validates better, but still leaves you with a few errors. Thank you for the help mate, much appreciated. And I've just noticed I managed to misspell fields .... I'm not with it today. Link to comment Share on other sites More sharing options...
eddie Posted January 18, 2017 Share Posted January 18, 2017 Sorry I've not been back to you for a couple of hours. Glad you got some help. Link to comment Share on other sites More sharing options...
Angry Ram Posted January 19, 2017 Share Posted January 19, 2017 Meh, you like lot beat me up to it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.