I am trying to create an online CV maker.I intend to use HTML form to get input from user and then put this text into a template/file. I am not able to figure out that how can i do so using JavaScript? Please guide me,Thank you
-
1Possible duplicate of stackoverflow.com/questions/742271/… ?Sim Hm– Sim Hm2020-09-04 16:35:47 +00:00Commented Sep 4, 2020 at 16:35
-
Thanks for your help.Can you please let me know how can i import my data(input taken from user using html form) to the solutions offered in the answers.Sorry this is the first time i am working with data or files.Mankrit Singh– Mankrit Singh2020-09-04 16:43:03 +00:00Commented Sep 4, 2020 at 16:43
Add a comment
|
1 Answer
First, in javascript you can get your input from the HTML by using javascript/JQuery
var input = document.getelementbyid("#id").value
or
var input = $("#id").val()
Then proceed like explained in the example of the topic (Generating PDF files with JavaScript)
var doc = new jsPDF()
doc.text(input, 10, 10)
doc.save('a4.pdf')
2 Comments
Mankrit Singh
Thanks for the answer i am new to this so will try and respond soon
Sim Hm
Use an id for each input of your form -> Upon validation, get the value(s) with JS or Jquery using the id(s) of the input(s) -> Generate the PDF using the jsPDF library