unsider Posted July 12, 2008 Share Posted July 12, 2008 http://signups.myspace.com/index.cfm?fuseaction=signup Do not enter any input, and scroll down to click the "Sign Up" submit button. After, you will notice the red outlines on the incomplete form boxes, and the the notices as to why the error occured. Im curious, are there any articles as to how this done, or if someone can briefly explain, or point me in the right direction. Just specifically the JS (red outlines, notices to the right, etc..) Greatly appreciated. Thanks. Quote Link to comment Share on other sites More sharing options...
xtopolis Posted July 12, 2008 Share Posted July 12, 2008 If you view their source, you can see the code they use. When you submit, it calls a javascript function to check the values to see if they are what is expected. If they aren't it uses javascript to change their CSS values, such as input.style.border = "1px solid red"; for the wrong ones. Then they use an onclick event to popup a div that has the appropriate error message (Stored at the bottom of their script). CSS, hiding/showing divs, all manipulated by javascript. Quote Link to comment Share on other sites More sharing options...
unsider Posted July 12, 2008 Author Share Posted July 12, 2008 Thank you, that's exactly what i wanted to know. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.