JQuery :: New Take On Form Validation, Code Review And Feedback?
Jun 2, 2009
I feel a bit guilty for posting this here as it may be considered as spam, so if you do think that please ignore/delete. For the last couple of days I've been working on a form validation plugin and I've taken a completely different approach (I think, that is) from what already exists. The result is a plugin with less than 300 lines of code that does absolutely no form validation at all. WTF you may very well ask, and I explain: the core of the plugin basically assigns/save 'rules' and callbacks on an object. One way to save/create a rule is when extending the plugin, i.e. adding validation rules, onerror/onsucces callbacks and the like. Another is
I have been developing JavaScript for websites on and off for about a year now, and have recently been working on a website project with a couple friends (the url). The project is about done and I think I'm ready to start telling everyone about it, but I thought I'd have some coders with more experience go through my code and suggest improvements that can no doubt be made. I've tested with the Error Console and run it through JSLint, so there shouldn't be too many worries there. It uses jQuery with no extensions. The code is fairly small so it shouldn't be too much of a hassle, only a couple hundred lines, nonetheless I won't post such a conglomeration here unless it is explicitly requested.
I'm wondering if there is a way to check if a form is valid withouttriggering UI feedback for invalid fields in the form? I tried boththe $('#myform').valid() and validator.form() methods, but they bothtrigger the UI.
How to build the code snippet that a 3rd party would add to their website page and the corresponding remote script that draws a review badge on a site similar to how tripadvisor does it?
You can see an example here if you scroll down to the bottom: http://www.hotel-grandmajestic.cz/en/about-hotel
I am looking to create a form in which, there will be multiple choices for the user to choose from. Each choice is a paragraph. The user will read the paragraphs and use the checkbox to choose which paragraph they prefer. There will be three sections of this type of choice field.the end, the user would have chosen three paragraphs, one in each field, in order to complete a one page essay. When it is complete, the user will see their essay, formatted and such and then will have the choice to save or print it out as a .pdf. Formatted just as they saw on their screen.
i want to create a feedback form for my website [url snipped]. as i m using free host it doesnt allow PHP so i want to create it using JAVA. please help me create a feedback form which when submitted automatically send an email to my ID.
I have created my second Form to File Web Form but basically I took my First Web Form coding (with the Java Script) and manipulated it so that it suited my needs for my 2nd Form (both are very close to being the same).For some reason, I can't get my Java Script validation to take effect. I was wondering if some one could try to pin point why it isn't functioning properly? Again it could be the most obvious thing, but please bear with me as I learn.Just for a little more clarity, I am going to list the things that I have changed to possibly make it easier to pin point:[code]
I have created a javascript for form validation. But I want to add some more functions in it. Like it should allow only US zipcodes. Phone Number will be in Number format only. I referred many other sites as well. But its getting difficult to add those new codes in my program.
Here is my Javascript Code: function validate(){ if(document.Enquiry.FirstName.value==""){ alert("Please enter Name"); document.Enquiry.FirstName.focus(); return false; }if(document.Enquiry.Address.value==""){ alert("Please enter Your Postal Address"); document.Enquiry.Address.focus(); return false; .....
I am trying to set up a looping structure that tests to see if the user enters a value. If the textbox is null then a global variable is false otherwise a checkbox is checked and the global variable is true.below is what i have done so far.
var isValid = false; window.onload = startForm; function startForm() {
I need a sample code.It should be like when i have two text fields without entering the first one when i keep the mouse in to the second text box it should say in the red mark as in the right hand side of text box..
I am trying to validate a ZIP code form entry to allow only numbers and exactly 5 digits. The following code validates for numbers only, but I can't get the 5-digit minimum integrated. correctly. onchange="if (/^.?$/.test(this.value) || !/^-?d*.?d*$/.test(this.value)) {alert('Numbers only please.'); this.value=''; this.focus()}
Does anybody know how i check to see if the radio button is select and also can anybody tell me how i can check for an email in the correct format the function isValidEmail in the above alows emails to pass through.
I have a form with multiple fieldsets which are visible conditionally. There are three submit buttons "Abandon", "Save" and "Save & Continue". Each button should validate specific controls of the form and submit it. I tried setting "onsubmit: false" and checking for "$('#myForm').valid ()" on click of these buttons., but that validates all controls of the form.
I am trying to display validation error messages when form validation fails. Currently it does display the error messages but then disappears straight away. How can I stop the page from refreshing when validation fails? I have return false in my code when validation fails but still having same problem. Currently I have only done the validation for the full name only. The error msg is showed in:
This is in regards to Jrn Zaefferer's plug in.How do you customize input validation so that I can remove foullanguage?So that first name or last name doesn't have "fck you" or something
I'm using the Validation plugin for JQuery and was wondering if there was a function to submit the form without causing it to validate the form. I have a table with a list of radio-buttons and above that is a drop down list of states. The drop down list of states is used to filter the table rows and when the selected item changes it posts-back to the server (via $("#frm").submit()). I don't want this to cause any validation to occur. Is there another function I can call besides submit(), or some other method?
I'm so happy my jquery is dispatching a serverside script (ajax) and it is working I have verified in the database.Now I would like to provide some feedback to the user so first go will be alert, later I will do something snazzy.I am just getting head around jQuery, so please excuse noobness of question. I will think that either one or the other of these alerts below would fire, but neither of them do and nothing also logs in the console.
I actually got two questions.it's regarding the website URL...
1) I'm building up the content from the database using JSON. Currently for each entry I build up the HTML code via Jquery and append it to the div. Is this the best way to do this or can this be done better/more efficient?
2) in the generated content I have a link that triggers the 'show/hide' function of a div below (URL...). Currently it doesn't work within the generated content. At the moment when clicking the link, it should create and alert, but even that isn't working. Is it possible to have a JQuery trigger within JQuery generate content?
I have an asp.net web application which includes jquery plugins and runs very well locally( ie using ASP.NET development server) but when deployed or published to IIS 5.0 the same is not working. Is there anything to do with jQuery not supporting IIS5.0 and ASP.NET 2.0.
After adding some lines of validation from Jorn's validate plugin, the addcar button on IE suddenly won't work, then safari is working, but not displaying updating properly after the animation, it will appear as if broken, but if you scroll up scroll down, then it would update. Chrome and firefox is okay.
Here is the button click code $('#addvehicle').bind('click',function(){ //ajax $.ajax ({ type: "POST", url: "addmorecar", data: "sessionid=" + $("#sessionid").val(), success: function(data){ $("#regaddcar").html(data).addClass('ui-widget ui-widget-content'); $("#regaddcar").fadeIn(); $("#addvehicle").attr('disabled','disabled').css('color','#CCCCCC'); }}); return false; }); // end of the on click add vehicle function .....
I need to validate two forms containing multiple input fields but want just one error message if any of the fields are left blank, the page is required to submit the users details (registration form). Also if any of these fields are left blank i don't want to be able to go to the next page on clicking the submit button
I am looking for a script that would enable users to rate and review products (ie rate it from 1-10 and leave comments about the product). The script must run on a NT server and be free. I know such a script must exist, but I have searched various script archives with no success. I have been considering hacking out my own using a flat file database, but I don't really have the time and don't want to re-invent the wheel.
I would like to add a prompt when a visitor of my website leaves the site or closes the browser.The prompt should be to optionally give his/her feedback about the site.
--> User can fill a simple form with comment & email id --> In this case, the comments should go to our mail id
--> The user can also leave the site without giving the feedback, saying NO to the prompt.
i need US zip code formatting on my page. as zip code can be 5 digits or 5-4 digits, our requirement is that when user types in 6th digit, hyphen automatically gets added between 5th and 6th digit. ex: user enters 100161,it should become formatted as 10016-1 and then user can continue to add rest of digits.
I have my website www.gebcn.com. If you view source you will see all that I have done, but more importantly my problem. I have the JS code at the top there and I am unable to W3C validate my HTML because of the JS. I am using XHTML strict and would like to stay using it.
The JS I have at the top is my form validation code. I am able to do any validating that I need with this "snippet" of code, I have shrank it from my library version just to use for this newsletter. Until now W3C validating was not important now for some reason it is and I am faced with this problem.
I am not a Javascript guy more of a HTML/CSS guy and I can manipulate JS to suit my needs.
<problem> I have tried to make this "snippet" of JS code an external file but receive multiple errors with the JS calling for the FORM NAME as it is not on the same page. The form NAME=NEWSLETTER is another problem, as W3C says I am unable to use attribute "NAME" in this location. <problem> I would like to keep the JS close to how it is now as I have a library to use this JS over and over again.