Confimration not appearing when it should do - javascript

A confirmation is not bing displaye after all validation has passed, instead it is showing a validation message stating no students have been selected to add even though I have done this. How can I get the confirmation to be displayed?
Here is an application you can use to see and use for yourself:APPLICATION
Select a course from drop down menu
In Avialable Students to Enrol box you will see list of students. Select a student and click on the Add button underneath and you will see that student added into the box underneath.
Click on the Submit Students button at the bottom and it displays the validation message saying you have no selected a student to add to course, but you have done this so the confirmation should appear. This is the problem
The jsfiddle showing the whole code for this is here:
http://jsfiddle.net/PhWbm/3/

You are checking for children of an element with the ID courseadd while the ID you should be looking at is studentadd. Try changing either the ID of the select or the selector.

Related

How to hide and show the input element conditionally while input onchange trigger in vueJs

I am using v-form-builder from https://github.com/sethsandaru/vue-form-builder .
I am trying to show and hide the fields & sections of the forms depending upon the business logic. I am able to hide the fields by applying additionalContainerClass “d-block”. But by doing so, other fields which had the values visible, they also goes blank.
To achieve this, I have used the following call-backs of vueJs.
mounted() {
//check the fields to hide
// hide the fields found by applying using the following code
this.formData.sections[action.field_section_id].additionalContainerClass = "d-block"
}
Now, as soon as the class of “d-block” is added to the field_section, other fields which had the values inserted, gets blank. Here is the video recording of the issue.
https://drive.google.com/file/d/1ztF22iGOW0msR3MAfG13qmgn7zo-4jh_/view?usp=sharing

How can I show a hidden DIV for a selection included with others?

I have a javascript file that when called, checks to see if a particular option is selected on a form. The form allows for multiple selections before being submitted. When a particular item is selected within the given choices it shows a hidden menu. In this case with "audits" I am able to show the hidden menu fine when just "audits" is selected from the list. However, I'm having much difficulty in figuring out how to get the menu to show when "audits" would be selected/highlighted with others. Eg: I had audits, services, someotheroption
Below you can see the code I'm currently using and that's working only when the single item is selected. Any guidance would be much appreciated.
function toggleFields(){
function toggleFields(){
if ($("#installations").val() == "audits"){
$("#dbcredentialsfield").show();
}
else
$("#dbcredentialsfield").hide();
}
Using the code you have so far, I assume you probably want something like this:
$('#installations').on('change', function(){
$("#dbcredentialsfield").toggle($(this).val() == 'audits');
});
This says; when the select element (assuming your dropdown has the id of installations) changes, toggle the visibility of the element with id dbcredentialsfield depending on if the value of the select is audits or not.

issue with jquery validation error messages

I have 3 radio groups each having 'yes' and 'no' value. Beside each of those radio groups there are 2 dropdown menus 'colour' and 'shade'.
PROBLEM:
When I select yes or no for radio button and nothing for the two drop downs and click submit i get an error 'Please select colour and shade for (USER)'. This is how I want it but when i click ok on this error I get please select attendance for USER2 immediately after. How do i remove this as I only want the first error displayed.
You appear to have 2 blocks running on input:submit.click(). So each time the button is pressed, it is running each block.

Prestahop one page checkout javascript

I use one page checkout option on my theme form prestashop.
While customizing I must have eliminated some id's so now on the cart page do when changing the quantity to zero while having one item in the basket, the effect doesn't work properly.
Normally when changing the quantity to 0 the row of the product disappears when changing the quantity to zero on the only element the whole form with userinfo + transport option and payment should be removed and left with a "cart is empty" text while I have the text the rest stays on the page.
I'e tried to search in the javascript code but could not find anything.
the page is abcmoto.pl you can add a item and go to the checkout process to see what i mean.

Problems with drop down list disabling

I have two drop-down select lists in my form as well as a textarea box.
The problem I am having is that, one a user creates a record, the record is then updated by another group but what I want to do, is prevent the other group from updating both select lists as well as the textarea box. I have disabled these items but when the user attempts to submit the form again, it looks like these items are not being posted and looks like the values are NULL.
I am using jQuery:
$('#DROP-DOWN1').attr("disabled", "disabled").addClass('itemDisabled');
$('#DROP-DOWN1').attr("disabled", "disabled").addClass('itemDisabled');
$('#TEXT-AREA').attr("disabled", "disabled").addClass('itemDisabled');
How I can prevent the user from modifying these items above but at the same time having the values posted?
Nice problem!
Can you hide them instead of disabling? Set visiblity to false
Another solution is to copy the values to an hidden input field. That one will get posted!
Work forward with this in mind: http://jsfiddle.net/uHQkx/
Instead of disabled try readonly.

Categories