Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- var formEntries = $(".form_entry").get();
- $(formEntries).each(function(){
- var temp = $(this).attr("id");
- console.log(temp);
- });
- //Function used for form submission, will have to
- $("#submit-button").click(function(){
- for(x in formEntries){
- if(x.children("input").hasBeenClicked != true){
- alert("Please fill in all the values before you press submit.");
- console.log(x.children("input").hasBeenClicked);
- return;
- }
- }
- $("#submit-button").text("Clicked!");
- alert("You Entered: " + $("#feedback-box").val());
- });
- // $("#clear-button").click(function(){
- // for(x in formEntries){
- // x.input.hasBeenClicked = false;
- // x.input.value = default;
- // }
- // })
- $(".form_entry").on("click",":input",function(el){
- var temp = $(el.currentTarget);
- temp.hasBeenClicked = true;
- console.log(temp.hasBeenClicked);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement