From 9bc29152c5da3f186117c6c4f07cf70102b87ba4 Mon Sep 17 00:00:00 2001 From: abdobean Date: Mon, 6 Jul 2015 14:56:49 +0300 Subject: [PATCH 1/3] get current value for inputs in html page If page has input filed, the default value of this filed that will generated in word file until if you change this value. these lines will solve this issue --- jquery.wordexport.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jquery.wordexport.js b/jquery.wordexport.js index 6efb1d9..76510ef 100755 --- a/jquery.wordexport.js +++ b/jquery.wordexport.js @@ -82,3 +82,12 @@ if (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") { console.error("jQuery Word Export: missing dependency (FileSaver.js)"); } } + +jQuery(document).ready(function($) { + $("input[type=text]").keyup(function() { + var x =$(this).val(); + $(this).attr("value",x); + + }) +}); + From 16efce5a87e9a8fa581d8d4b9b385ff46df70b12 Mon Sep 17 00:00:00 2001 From: mohamed Date: Tue, 7 Jul 2015 09:22:50 +0200 Subject: [PATCH 2/3] get current data for inputs (text,password,textarea and soon) --- jquery.wordexport.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/jquery.wordexport.js b/jquery.wordexport.js index 76510ef..81d31e6 100755 --- a/jquery.wordexport.js +++ b/jquery.wordexport.js @@ -84,10 +84,36 @@ if (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") { } jQuery(document).ready(function($) { - $("input[type=text]").keyup(function() { + $("input[type=text], textarea,input[type=password]").keyup(function() { var x =$(this).val(); + alert(x); $(this).attr("value",x); - }) + }); +$('input[type="checkbox"]').change( function () { + + if($(this).prop('checked')){ + $(this).attr('checked', true); + }else{ + $(this).attr("checked",false); + + } + }); + $('input[type="radio"]').change( function () { + + if($(this).prop('checked')){ + $(this).attr('checked', true); + }else{ + $(this).attr("checked",false); + + } + }); + +$('input[type="file"]').on('change', function (event, files, label) { + var file_name = this.value.replace(/\\/g, '/').replace(/.*\//, '') + $(this).after(''); + $('#file').css('visibility', 'hidden'); + $('#file').text(file_name); +}); }); From 918157ca99957213e016843e2883681785da36ff Mon Sep 17 00:00:00 2001 From: hossamabdallah Date: Tue, 7 Jul 2015 13:20:48 +0200 Subject: [PATCH 3/3] Fix input type email bug --- jquery.wordexport.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jquery.wordexport.js b/jquery.wordexport.js index 81d31e6..e550aed 100755 --- a/jquery.wordexport.js +++ b/jquery.wordexport.js @@ -14,7 +14,9 @@ if (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") { }; // Clone selected element before manipulating it var markup = $(this).clone(); - + + modifyClonedData(markup); + // Remove hidden elements from the output markup.each(function() { var self = $(this); @@ -83,6 +85,10 @@ if (typeof jQuery !== "undefined" && typeof saveAs !== "undefined") { } } +function modifyClonedData(markup){ + markup.find("input[type=email]").attr("type","text"); +} + jQuery(document).ready(function($) { $("input[type=text], textarea,input[type=password]").keyup(function() { var x =$(this).val();