tomindo Posted April 14, 2011 Share Posted April 14, 2011 Hi guys I got the js script below which loops through all form inputs , then check if the field value changes to other value rather than the default but for some reasons the if condition does not work, no error showed. Really need someone to shed a light on it. Maybe give me some other solutions to fulfil this task $(document).ready(function() { $("select").change(function(){ $("form").find("input").each(function(i) { if (this.value != this.defaulValue) { alert(this.value); } else { alert("no update"); } }); }); Link to comment https://forums.phpfreaks.com/topic/233657-form-only-update-change/ Share on other sites More sharing options...
Zane Posted April 14, 2011 Share Posted April 14, 2011 First off, you mispelled defaultValue.. secondly, jQuery doesn't have a builtin function for defaultValue this should be helpful http://www.miuaiga.com/index.cfm/2009/8/31/jQuery-form-input-defaultValue Link to comment https://forums.phpfreaks.com/topic/233657-form-only-update-change/#findComment-1201439 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.