So, I have the need to produce a very simple web page that would allow for a user on a VERY secure intranet to edit the page, push SAVE, and have the text save to a file on the same web server. The path/name of the file would be fixed and non editable by the user. My basic layout is below.
Here's the code so far. Stupid simple stuff. However, I have a question on where to go next. How do I power the buttons? I mean, I know what I want to do, save text to the file, delete the file, etc. but, how do I go from showing buttons to having them actually do something? (I'd prefer to stay in javascript if I can.)
Note: The environment is NOT an IIS server and I already have some javascript running. (I believe the Web server is Tomcat.)
Thanks!
Edit: I'll be changing this up as I try and figure it out....
More to work with
Here's the code so far. Stupid simple stuff. However, I have a question on where to go next. How do I power the buttons? I mean, I know what I want to do, save text to the file, delete the file, etc. but, how do I go from showing buttons to having them actually do something? (I'd prefer to stay in javascript if I can.)
Note: The environment is NOT an IIS server and I already have some javascript running. (I believe the Web server is Tomcat.)
Code:
<!DOCTYPE html> <html> <body> <h1> Message tester</h1> <p>Enter the desired text below</p> <form> <textarea rows="10" cols="90"> </textarea> <p> <input type="submit" value="Save"> < input type="submit" value="Delete Current"> </form> </body> </html>
Edit: I'll be changing this up as I try and figure it out....
More to work with
Code:
<!DOCTYPE html> <html> <body> <h1>Message tester</h1> <p id="MessageArea"> Enter the desired text below </p> <script> function SaveText() { document.getElementById("MessageArea").innerHTML="This would save!"; } function DeleteCurrent() { document.getElementById("MessageArea").innerHTML="This would delete!"; } </script> <form> <input type="text" id="mytextbox" value="Hello World!" /> <p> <button type="button" onclick="SaveText()">Save</button> <button type="button" onclick="DeleteCurrent()">Delete Current</button> </form> </body> </html>
Comment