I have a JS object as follows:
var actType = {
form : $form,
input : "select[name='journalEntry.activityType']",
valid : $form.find("select[name='journalEntry.activityType']").val() === "",
errorClass: "sr-error-task",
errorMessage: "Please select a task."
};
My questions are:
- Is it possible to reference the $form value in the actType.valid parameter with actType.form?
- Would the first actType.form = "test" and the second actType = "pass" considering this code?
For example:
$form = "test";
var actType = {
form : $form,
input : "select[name='journalEntry.activityType']",
valid : $form.find("select[name='journalEntry.activityType']").val() === "",
errorClass: "sr-error-task",
errorMessage: "Please select a task."
};
$form = "pass";
actType = {
form : $form,
input : "select[name='journalEntry.activityType']",
valid : $form.find("select[name='journalEntry.activityType']").val() === "",
errorClass: "sr-error-task",
errorMessage: "Please select a task."
};