Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While submitting #36

Closed
vijaya09 opened this issue Sep 28, 2015 · 7 comments
Closed

While submitting #36

vijaya09 opened this issue Sep 28, 2015 · 7 comments

Comments

@vijaya09
Copy link

While trying to submit the form we are unable to do that. We got the following issue.

Uncaught Error: Winterfell: Attempted to validate for undefined method "undefined"

image

@andrewhathaway
Copy link
Owner

Hi there @vijaya09.

With the schema in the right I don't see any issues, however it may be an issue with the other part of the schema. Can you post the rest of your schema in PasteBin or something?

@vijaya09
Copy link
Author

Thanks for your response @andrewhathaway.

Please find the complete schema below.

Thanks,

module.exports = {
"classes" : {
"form" : "login-form",
"input" : "form-control",
"controlButton" : "btn btn-primary pull-right",
"errorMessage" : "alert alert-danger",
"buttonBar" : "button-bar"
},
"formPanels" : [{
"index" : 1,
"panelId" : "register-panel"
}],
"questionPanels" : [{
"panelId" : "register-panel",
"panelHeader" : "Task List",
"panelText" : "Please enter following details.",
"action" : {
"default" : {
"action" : "SUBMIT",
"target" : "http://google.com"
}
},
"button" : {
"text" : "Submit"
},
"questionSets" : [{
"index" : 1,
"questionSetId" : "register-set"
}]
}],
"questionSets" : [{
"questionSetId" : "register-set",
"questions" : [{
"questionId" : "task-ID",
"question" : "Task ID",
"input" : {
"type" : "textInput",
"placeholder" : "Task ID 0000",
"required" : true
},
//Check if entry is a number and doesn't accept special characters
"validations" : [{
"type" : "isInt",
},
//Task ID exactly 4 characters
{
"type" : 'isLength',
"params" : [4,4]
}]
}, {
"questionId" : "task-name",
"question" : "Task Name",
"input" : {
"type" : "textInput",
"placeholder" : "Task Name"
},
"validations" : [{
"type" : "isLength",
"params" : [1,50]
}]
}, {
"questionId" : "time-to-complete",
"question" : "Time to Complete",
"input" : {
"type" : "radioOptionsInput",
"options" : [{
"text" : "0-15 Minutes",
"value" : "1"
}, {
"text" : "16-30 Minutes",
"value" : "2"
}, {
"text" : "31-45 Minutes",
"value" : "3"
}, {
"text" : "46-60 Minutes",
"value" : "4"
},
{
"text" : "1+ Hour",
"value" : "5"
}]
},
"validations" : [{
"type" : "isIn",
"params" : [
[1, 2, 3, 4, 5]
]
}]
},{
"questionId" : "description",
"question" : "Description",
"input" : {
"type" : "textareaInput",
"placeholder" : "Describe Task"
}
},{
"questionId" : "start date",
"question" : "Date",
"input" : {
"type" : "textInput",
"placeholder" : "MM/DD/YYYY"
},
// Make sure date is entered
"validations" : [{
"type" : "isDate",
"matches" : "(mmddyyyy, 'mm/dd/yyyy' )"
}]
},{
"questionId" : "email",
"question" : "E-mail ID",
"input" : {
"type" : "emailInput",
"placeholder" : "foo@example.com",
"required" : true
},
// Make sure email is entered
"validations" : [{
"type" : "isEmail"
}]
},{
"questionId" : "password",
"question" : "Password",
"input" : {
"type" : "passwordInput",
"placeholder" : "8 characters minimum",
"required" : true
},
// Make sure password is entered
"validations" : [{
"type" : "isLength",
"params" : [1]
}]
},{
"questionId" : "passwordConfirm",
"question" : "Password Confirm",
"input" : {
"type" : "passwordInput",
"placeholder" : "confirm password"
},
"validations" :[{
"type" : "equals",
"params" : ["{password}"]
//"matches" : "({passwordConfirm}, {password} )"
//"message" : "Confirm password must match password field"
}]
},{
"questionId" : "status",
"question" : "Status",
"input" : {
"type" : "radioOptionsInput",
"options" : [{
"text" : "Done",
"value" : "1",
"conditionalQuestions" : [{
"questionId" : "doneLabel",
"question" : "Heyyyy!! you are done!!",
"input" : {
"type" : "radioOptionsInput"
},
"validations" : [{
"params" : ["yes"]
}]
}]
},{
"text" : "In Progress",
"value" : "2",
"conditionalQuestions" : [{
"questionId" : "progressLabel",
"question" : "Why aren't you done at!!",
"input" : {
"type" : "radioOptionsInput"
},
"validations" : [{
"params" : ["yes"]
}]
}]
}]
},
"validations" : [{
"type" : "isIn",
"params" : [
[1, 2]
]
}]
}]
}]
};

@vijaya09
Copy link
Author

@andrewhathaway

In the same schema that I have posted, I have another issue regarding the password confirmation. Even if I am giving the same password in both password and confirm password fields it is not validating. Could you please let me know if there is any problem with the schema.

screen shot 2015-09-29 at 9 39 54 am

Thanks,

@andrewhathaway
Copy link
Owner

Hi there. It would have been much better if you posted the schema in PasteBin, like I mentioned. Also, check #34.

Thanks.

@andrewhathaway
Copy link
Owner

Also @vijaya09.

The issue with your validation methods not working is where you have not specified a type property for one of your validation sets, lower down the schema.

@vijaya09
Copy link
Author

Hi @andrewhathaway

Please find the link below

http://pastebin.com/62R64QTq

Thanks,

@vijaya09
Copy link
Author

Hi there @andrewhathaway

Submit button worked.. Thank you..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants