Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6227969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:18:32+00:00 2026-05-24T09:18:32+00:00

I have an html site with a form in it and I want the

  • 0

I have an html site with a form in it and I want the user to be able to create a text/xml file depending on the input. But I wan’t to avoid setting up a webserver only for this task.

Is there a good way, to do that, e.g. with Javascript? I think you can’t create files with Javascript, but maybe create a data url and pass the text, so the user can save it to file?

Or is there another way to achieve this simple task without a webserver?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:18:33+00:00Added an answer on May 24, 2026 at 9:18 am

    Solved it, somehow. I create a data url data:text/xml;charset=utf-8, followed by the XML.

    function createXML() {
        var XML = 'data:text/xml;charset=utf-8,<MainNode>';
        var elements = document.getElementsByTagName('input'),i;
        for (i in elements) {
            if (elements[i].checked == true) {
                XML += elements[i].value;
            }
        }
        XML += '</MainNode>';
        window.open(XML);
    }
    

    So the url looks like data:text/xml;charset=utf-8,<MainNode><SubNode>...</SubNode>...</MainNode>

    Unfortunately this doesn’t work for me on Chromium(Chrome) and on Firefox. It just displays the XML instead of showing a save dialog. But I think that’s because of my settings and at least you can save it as a XML-file manually.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have html form and I want to add validation on user input -
i have this simple html form: <form action=test/ method=get accept-charset=utf-8> <input type=text name=first value=
i have this simple html form: <form action=test/ method=get accept-charset=utf-8> <input type=text name=first value=
I have a web site that contains an HTML form, in this form I
I have an html file containing <img width=10 height=12 scr=https://www.site.com/yughggcfgh> <img width=11 height=15 scr=https://www.site.com/yughggcfghcvbcvb>
I have an html input field, such as <form method=post action=process.php enctype=multipart/form-data> <div> <h3>Files:</h3>
In my Rails 3.2 project, I have a form to create a new site
I have a site that is to create a user account. The site currently
Possible Duplicate: How to have user submit text in form and AJAX it to
I have a simple form I want users to be able to log into;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.