Click here to Skip to main content
15,887,214 members
Home / Discussions / JavaScript
   

JavaScript

 
RantREPOST Pin
Richard Deeming15-Apr-16 1:56
mveRichard Deeming15-Apr-16 1:56 
PraiseRe: REPOST Pin
John C Rayan15-Apr-16 4:48
professionalJohn C Rayan15-Apr-16 4:48 
QuestionEXT JS 2.2 - File upload control Pin
Hemant Thaker13-Apr-16 3:39
Hemant Thaker13-Apr-16 3:39 
QuestionHow to hide "save as" button in IE11 Pin
vivek rajavel11-Apr-16 20:18
vivek rajavel11-Apr-16 20:18 
AnswerRe: How to hide "save as" button in IE11 Pin
John C Rayan15-Apr-16 3:44
professionalJohn C Rayan15-Apr-16 3:44 
GeneralISBT Barcode Pin
Praveen Kandari10-Apr-16 20:28
Praveen Kandari10-Apr-16 20:28 
GeneralRe: ISBT Barcode Pin
Richard MacCutchan10-Apr-16 20:50
mveRichard MacCutchan10-Apr-16 20:50 
QuestionOdd TypeError being thrown. Pin
Dralken5-Apr-16 9:57
Dralken5-Apr-16 9:57 
Working on a website in Node.JS, and I've been doing good so far, but I've hit an error that has me stumped.

TypeError: Cannot set property 'isSubmitted' of undefined
   at app.post.res.locals.showform (/media/sf_Node.js/SmartCage2/user.js:76:25)
   at Layer.handle [as handle_request] (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/layer.js:95:5)
   at next (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/route.js:131:13)
   at Route.dispatch (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/layer.js:95:5)
   at /media/sf_Node.js/SmartCage2/node_modules/express/lib/router/index.js:277:22
   at Function.process_params (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/index.js:330:12)
   at next (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/index.js:271:10)
   at jsonParser (/media/sf_Node.js/SmartCage2/node_modules/body-parser/lib/types/json.js:100:40)
   at Layer.handle [as handle_request] (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/layer.js:95:5)

The section that's throwing the error:
JavaScript
app.get('/login', function (res, req) {
	res.locals.isSubmitted = false;
	res.render("user/login.html");
});


The odd thing is, I use the same code above this, and it works.
JavaScript
app.get('/register', function(req,res) {
	res.locals.isPosted = false;
	res.render("user/register.html");
});


I have the forms submitted to the corresponding page (/login to /login, /register to /register), and I use the Nunjucks template system to show relevant data depending on how whether it was accessed via GET or POST.

I have no idea why it would be throwing the error on one section, but not the other.

I do, however, want to note that I barely know Javascript. I've always used strongly typed languages. I don't even like using 'var' in C#.
AnswerRe: Odd TypeError being thrown. Pin
Richard MacCutchan5-Apr-16 21:25
mveRichard MacCutchan5-Apr-16 21:25 
GeneralRe: Odd TypeError being thrown. Pin
Dralken5-Apr-16 21:31
Dralken5-Apr-16 21:31 
GeneralRe: Odd TypeError being thrown. Pin
Richard MacCutchan5-Apr-16 21:52
mveRichard MacCutchan5-Apr-16 21:52 
QuestionGet data from mysql database if checkbox is selected Pin
TaRoshka5-Apr-16 0:49
TaRoshka5-Apr-16 0:49 
QuestionNot really a question, but.... Pin
Wombaticus2-Apr-16 0:08
Wombaticus2-Apr-16 0:08 
AnswerRe: Not really a question, but.... Pin
Richard Deeming4-Apr-16 2:00
mveRichard Deeming4-Apr-16 2:00 
GeneralRe: Not really a question, but.... Pin
Wombaticus10-Apr-16 23:12
Wombaticus10-Apr-16 23:12 
AnswerRe: Not really a question, but.... Pin
F-ES Sitecore10-Apr-16 22:55
professionalF-ES Sitecore10-Apr-16 22:55 
GeneralRe: Not really a question, but.... Pin
Wombaticus10-Apr-16 23:11
Wombaticus10-Apr-16 23:11 
GeneralRe: Not really a question, but.... Pin
Richard Deeming11-Apr-16 1:25
mveRichard Deeming11-Apr-16 1:25 
GeneralRe: Not really a question, but.... Pin
Wombaticus11-Apr-16 1:33
Wombaticus11-Apr-16 1:33 
QuestionHow to hide the URL textbox using javascript Pin
zdbl20924-Mar-16 8:58
zdbl20924-Mar-16 8:58 
AnswerRe: How to hide the URL textbox using javascript Pin
Richard Deeming24-Mar-16 9:10
mveRichard Deeming24-Mar-16 9:10 
GeneralRe: How to hide the URL textbox using javascript Pin
zdbl20924-Mar-16 9:27
zdbl20924-Mar-16 9:27 
GeneralRe: How to hide the URL textbox using javascript Pin
Nathan Minier25-Mar-16 1:08
professionalNathan Minier25-Mar-16 1:08 
AnswerRe: How to hide the URL textbox using javascript Pin
ZurdoDev29-Mar-16 2:41
professionalZurdoDev29-Mar-16 2:41 
AnswerRe: How to hide the URL textbox using javascript Pin
F-ES Sitecore30-Mar-16 0:03
professionalF-ES Sitecore30-Mar-16 0:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.