User Profile
Collapse
-
yes i've tried that. For example, I've tried to add it to each validation function just above return false and it works in a way but it starts at the bottom. So my top error message will display(if im validating an empty form) but the focus goes to the bottom field. Why would that be? Where else can i add it? -
How to add focus to validation error?
I have a validation file and i do not know where to add the focus so that with each error it focuses on the field where the error occured. Maybe someone will have a better idea on how to do this. Here is my code:
...Code:<code> <script> // get the div element for the error messages var errorElem = document.getElementById("error"); // define some variables to store the values of the form elementsLast edited by Niheel; Mar 10 '11, 11:28 PM. Reason: That's a bit too much code for most people to read through, you might want to edit out to only leave the parts necessary for your question. -
-
I've tried that but I'm just not sure how exactly to do that within my code and have it work.Leave a comment:
-
Taylor Smith started a topic How do I un-select a drop-down selection when a checkbox is un-checked?in JavascriptHow do I un-select a drop-down selection when a checkbox is un-checked?
I have a checkbox that when selected it fills in the shipping address(to match the billing address. When un-checked it should clear all the fields in the shipping address section of the form. It works up until the drop downs. I have tried multiple ways of formatting it but i can't seem to get it to clear once the checkbox is un-checked. Any assistance would be great.
...Code:<script> var shipName = "";
-
To set the life of the cookie to 0 would i do this?
...Code:<script> function getCookieExpiry(rememberMe) { var expiresDate; if (rememberMe === true) { // set time, it's in milliseconds var today = new Date(); today.setTime( today.getTime() ); /* This will set the expiry date for x number of days. To make it forLast edited by Dormilich; Mar 9 '11, 05:22 PM. Reason: please use [CODE] [/CODE] tags when posting codeLeave a comment:
-
How do I make a session cookie?
How do I make this code below into a session cookie that deletes once the page is closed?
...Code:<script> /* Very simple validation for the login. */ function validateLogin() { var username = document.getElementById("username").value; var pwd = document.getElementById("password").value; // encrypt the username and password var userEntryEncryption -
Yes thank you the parentheses were missing but it turns out billing info should have been where shipping info was and vice versa. ThanksLeave a comment:
-
Or might it possibly be that the <fieldset> is messing up the way I access the form elements?Leave a comment:
-
There appears to be no errors when inspected with firebug so it has me baffled....
I took the script exerpt above from my js file that is attatched in the head section of the document. Maybe my issue is how i have called the script. Would I add the script tags to the head section or should it be added in the body below the checkbox? Here is my script tag:
<script type="text/javascript" src="javascrip...Leave a comment:
-
How to copy billing address to shipping address?
Hi I am new with javascript and am trying to make it so that once the billing address on my page has been filled out, you click a checkbox(if billing info is same as shipping) and it copies the info to shipping address. I have tried approaching this several ways and tried google-ing for help as well but i cannot seem to get anything to work. Here is the code that i have most recently tried:
...Code:<script> function copyAddress
Last edited by Niheel; Feb 26 '11, 02:46 AM.
No activity results to display
Show More
Leave a comment: