Please help with html

Started by
1 comment, last by DiegoSLTS 9 years, 10 months ago

Hello everyone.I need help with the file attached, I need that when the user clicks submit a word file or pdf pops up with the same website but with the input shown..how can i do this? if you know could you please at least show me a simple example or something, Ive been trying really hard but can't get nowhere

Advertisement
Hmm? Is there something wrong with your other thread?

It is not possible for javascript to create a document or PDF; such an attachment must be served from a server. PHP, ASP.NET, nodejs server, whatever floats your boat. Apparently it is possible with downloadify.

EDIT:
Anyway, something like this should work:
# coffeescript
# requires jQuery
($ '#cmd').click ->
  ($ 'input').each ->
    $this = $ @
    $span = ($ '<span>').text $this.val()
    $this.after $span
    $this.remove()
    return
  return
Granted, it doesn't create a PDF or word document, but you could print the web page.

Here's a Javascript plugin to create a PDF file and trigger a download: http://parall.ax/products/jspdf

I haven't tested it, but it says is all done in client side, which sounds perfect for a site that's only one html file. It has an option to put in the PDF any part of the rendered HTML, or you can create the content all in JavaScript.

This topic is closed to new replies.

Advertisement