0

I have created a Login Form. After submitting the form, the data must be stored in an XML File by using the javascript. Is it possible to store the data in an XML File after submitting the Form?

 <div class="login">
            <label><b>User Name</b></label><br /><br />
            <input type="text" name="uname" pattern="[a-zA-Z]{3,}" title="Enter a-z/A-Z wih minimum 3 Characters" required/><br /><br />    
            <label><b>Password</b></label><br /><br />
            <input type="password" name="pwd" pattern="^((?=.*(\d|\W))(?=.*[a-zA-Z]).{8,})$" title="Please Enter One Special Character,Alphabets and Numbers with minimum 8 Characters" required/><br /><br />
            <span style="padding-left:20px;"><a href="#">Forgot password?</a></span><br /><br />    
            <button type="submit">Login</button>         
        </div>
cchamberlain
  • 17,444
  • 7
  • 59
  • 72
harika
  • 1
  • 6
  • 2
    Using JavaScript where? If you're posting a form, what matters is the software running on your *server*. That *might* be JavaScript, but you've provided no details. – Pointy Dec 21 '16 at 13:16
  • No server is running. We just need to save that in an XML File which is located in visual studio projects folder – harika Dec 21 '16 at 13:17
  • The `required` attribute will not work if the input field with the attribute is not a child of a form element. – Wais Kamal Dec 21 '16 at 13:21
  • "submitting the form" means "sending the form data to a server". – Pointy Dec 21 '16 at 13:23
  • Possible duplicate of [How to read/write local files through a web page?](http://stackoverflow.com/questions/12023858/how-to-read-write-local-files-through-a-web-page) – user812786 Dec 21 '16 at 15:05

1 Answers1

0

Javascript is a client side scripting language. I don't think javascript can do this, and even if possible with javascript, this would be a great security threat. Therefore, consider using a server side scripting language. I would recommend PHP.

Wais Kamal
  • 5,858
  • 2
  • 17
  • 36