Basically, the batch number, expiry date and pallet/box number is mandetory. If they arn't entered, it needs to fail (return false). It doesn't seem to be doing anything, just moving on to the next part which is checking other parts of the form which isn't repeated.
//Event Registrations (Variable Declarations) found in validation_chkr.js //Validate Entire Form using validate_join() function validate_join()
I am somewhat a noob at js/jquery so I wasn't sure exactly how to do this. Think I just need a push in the right direction. Basically I'm trying to validate a form (jquery validation) with a couple of conditionals based on a selection box. So I have:
I have a form that makes visible a text field when a specific radio button is checked. That works. Then I validate to see if a radio button is checked before I let the form be submitted. That works.
BUT - I cannot seem to get it to validate the form field that is made visible to see if it has content or at least the proper content when the form is submitted. Can you tell me what I am doing wrong please?
I can give more info on what kind of validation I want done if needed, but I think my code speaks for itself Code:
I have a form with a field that asks for a full year. If the year is greater than 20 years ago, I'd like additional form fields to be revealed. If the year is equal to or less than 20 years ago, it will not reveal the fields. (And it should be based on getFullYear(), so I don't have to update the script every year, yeah?)
I figured out how to script onclick functions and some basic .value == functions in order to show/hide just about every type of form field. So I don't need that info. But I'm unsure of how to calculate the value.
So I have to ask some stupid questions and make sure that there is not something wrong in this simple syntax. I am trying to get input field attributes type and tagname by field ID. Heres the code..
When I look in firebug I see there is the correct ID in input_id variable and that the input field with that id exists. But for tag and type variables I just get 'undefined' for reason unknown.. syntax is correct or?
I want to validate a form. In the form is a text field named 'extra' where the user inputs a number. The number is what I want to validate.
However, the 'extra' field is dynamic and does not always appear in the form.
If it appears, there may be only 1 occurrence of it which means it's then not an array but there may also be multiple occurrences of it.
I have a script that validates (and work as it should) if the 'extra' field occurs multiple times and is thereby an array, but I can't figure out how to validate the 'extra' if there is only 1 and to not throw an error if it's not there at all. Code:
I have an order form where a customer can select a number of artwork prints supplied by different artists and suppliers. The name, price, postage amount and other details for each of the prints are held in a table in a MySQL database. As postage amount may vary between prints and suppliers of the prints we must have the customer select postage per print - not the amount just yes or no. The customer may select as many of these prints as he desires - printa, printb, printc, printd etc. through to printz. Many of the prints are provided by separate individual suppliers and must therefore have postage paid for each ordered print and this is automatically added by the order form. However some prints are provided by the same supplier and only one postage fee needs to be chosen (yes or no), so these are not automatically added and the customer must choose to pay postage on only one of the prints (not all 3 if he orders 3 of them).
So for postage purposes I have a postage code on the table in the MySQL database. For example printa, printb and printc are all supplied by the same supplier so each have a linked postage code of A. Similarly others may also be linked using different postage codes e.g. printx and printy may have a postage code of B. So whenever a customer chooses a print that does not have a linked postage code then the postage fee is automatically selected for him and charged to the total. However where prints are linked to the same postage code we must allow the costomer to select postage (yes or no), but we must force him to select yes or no for at least one of the linked prints.
To validate the form I'm using jquery simple validation. In order to validate a section I put the "class="required" around it but for the select fields I was wondering if it would be possible to display a pop up if they aren't selected?
<select name="sltDay"> <option value="">day</option> <% For i = 1 to 31
I have tried numerous attempts in getting the Address field to work (i.e. validated). I want it to accept letters, numbers, spaces and commas! However, it won't let me! Below is the code I have provided.
One problem though... for other reasons these form field names all begin with either a "r^" or a "t^" signifying it as either a text field or radio button. I can get the check to work fine without the "r^" but with it I'm lost. The carrot seems to be causing problems for me and I've tried many different combinations of things to get it to work. Code:
[code]I have created an array of cars so if personA has more cars, they can click add and select another one. If they have 1 car and just enter name and 1 car, the form works but when I click Add row and select another car, it doesnt work?