HTML: How to output to .txt or xml file - html

How I'm trying to create a survey and out the answers to a text or xml file.
is that possible in HTML?
<html>
<head>
<title>Testing the Survey Application</title>
</head>
<body bgcolor="#E6E6FA">
<font color=black size=+3>Modifying Sentiment</font>
<hr>
Add positive adjective:
<img Adjective src="http://findicons.com/files/icons/2776/android_icons/96/ic_question_mark.png" alt="question" title="Adjective: is a word naming an attribute of a noun, such as sweet, red, or technical."
width=20 />
<br>
<textarea cols=40 rows=3 name=textBox1></textarea>
<p>
<hr>
<input type=submit value=Submit>
<input type=reset value=Clear>
<br>
</form>
</body>
</html>

HTML is a markup language. It is used to describe the elements of a web page.
If you want functionality, such as submitting and processing forms, for example. You will need to add a server-side language, such as Python, PHP, Ruby, among many others.

Related

HTML Live field in Ironspeed

I've been trying to add a live output field to my ironspeed application but I have not been successful, the Ironspeed mobile app reads all the fields but it does not display the live output field. I tried searching in the Ironspeed forums, and I watched a number of their youtube videos, where they show you how to enter HTML in Ironspeed but I have not been successful, here is a snippet:
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>Output element sample</title>
<body>
<article>
<header>
<h1>Output element sample</h1>
<p>Demo showing output element in HTML5</p>
</header>
<form onsubmit="return false" oninput="totalamount.value = Math.round( Qty.value * exchangerate.value)">
I have<input name="Qty" id="Qty" type="number">
<br />
Exchange Rate<input name="exchangerate" id="exchangerate" type="number">
<br />
Total amount <output name="totalamount" id="totalamount" for="principal period interest"></output>
</form>
<footer>
<h1></h1>
<p>HTML Goodies</p>
</footer>
</article>
</body>
</html>
I would really appreciate some assistance in the matter.

Why is the file upload ignoreing the language setting?

I have an English and German site, where the user can switch from English to German. When the user switches the site, the content is translated, the language information is set (lang="en", lang="de") but file upload (<input type="file">) is in German. Is there a way to translate it without customizing the file upload?
Example (egnlish):
<html lang="en" xml:lang="en">
<head>
<title>Internationalisation test</title>
</head>
<body>
<form>
<input type="file" name="test">
</form>
</body>
</html>
Example (german):
<html lang="de" xml:lang="de">
<head>
<title>Internationalisation test</title>
</head>
<body>
<form>
<input type="file" name="test">
</form>
</body>
</html>
The file input button's caption is not in German per se, but in web browser's language. Should you use a web browser with different language pack or install it on different OS language, the language would be different.
Is there any way to fix this?
Yes and no.
I'll start with no. If you want to stick to standard HTML control <input type="file"> there is no way to translate the caption.
What you can do though, is to replace the control with non-standard one (usually people tend to use flash-based file upload controls), or... The other way is to actually hide the control (setting z-axis) and put your own text box and a button over it.
That's basically it.

Setup Spring and Spring-Security to use HTML file

In a web application, we don't want to use JSP files, we want to use only HTML files. Each view is a template.
I'm looking for a way to setup spring, spring security to use directly login.html file and if the user authentificates correctly the generic layout (top level, left level, right level and center level and south level) will be displayed.
What you are looking for is a natural templating solution where the templates are built directly in HTML and CSS with just some special atributes in the tags, but without the need for a set of XML tag libraries.
One solution that allows this is the Thymeleaf templating technology - Comparison of a Thymeleaf template with a JSP in a Spring application
this is how a template looks like:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Spring MVC view layer: Thymeleaf vs. JSP</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="all"
href="../../css/thvsjsp.css" th:href="#{/css/thvsjsp.css}"/>
</head>
<body>
<h2>This is a Thymeleaf template</h2>
<form action="#" th:object="${subscription}" th:action="#{/subscribeth}">
<fieldset>
<div>
<label for="email" th:text="#{subscription.email}">Email: </label>
<input type="text" th:field="*{email}" />
</div>
<div>
<label th:text="#{subscription.type}">Type: </label>
<ul>
<li th:each="type : ${allTypes}">
<input type="radio" th:field="*{subscriptionType}" th:value="${type}" />
<label th:for="${#ids.prev('subscriptionType')}"
th:text="#{'subscriptionType.'+${type}}">First type</label>
</li>
<li th:remove="all"><input type="radio" /> <label>Second Type</label></li>
</ul>
</div>
<div class="submit">
<button type="submit" name="save" th:text="#{subscription.submit}">Subscribe me!</button>
</div>
</fieldset>
</form>
</body>
</html>

How to print user input data on screen

When the user inputs data into each box and then clicks submit, how would I have that information stored into some memory so it can be outputted onto the screen. It is ok if the page is refreshed and all data is lost. As long as it is possible to output the data while on the page. I was told html5 could do this without the need of the page refreshing.
Basically, I want the user to input a Job ID, a Date and a description. The user then clicks submit. the data is then outputted onto the table.
My Code is probably not worth much here, I just have it up so people know where I'm standing.
And I understand it's not as simple as just writing a bit of code. I just need someone to give me a bit of direction, where exactly I should start and how I should approach this. I've searched the internet but I couldn't find what I needed. I'd like the simplest way to output the user input onto the screen. I want to try and avoid any heavy programming or any new languages for the moment but if that's not possible then let me know.
I was also told to use the 'memory' for storing. That's all the information I was given. I apologize if I haven't asked the question very technically, I've only began using HTML5.
<!doctype html>
<html lang = "en">
<head>
<meta charset="utf-8" />
<title>Form table</title>
<link rel="stylesheet" href = "testing.css" />
</head>
<body>
<section>
<div class = "scrollWrapper">
<table>
<tr>
<th>Job ID</th>
<th>Date</th>
<th>Description</th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</section>
<section id = "sec2">
<form name="input" action="html_form_action.asp" method="get">
<p>Job ID:</p><input type="text" name="jobid"><br>
<p>Date:</p><input type="text" name="date"><br>
<p>Description:</p> <input type="text" name="description"><br>
<br>
<input type="submit" value="Submit">
</form>
</section>
</body>
</html>
I think you are going to need a little bit of JavaScript in order for that to work. You don't need memory (since you say it doesn't matter if the data gets lost on page refresh).
HTML5 has an <output> element where you can output what a user inputs.
<!doctype html>
<html lang = "en">
<head>
<meta charset="utf-8" />
<title>Form table</title>
<link rel="stylesheet" href = "testing.css" />
<script>
function display(form){
form.o_jobid.value = form.jobid.value;
form.o_date.value = form.date.value;
form.o_description.value = form.description.value;
return false;
}
</script>
</head>
<body>
<form name="input" action="" method="get" onsubmit="return display(this);">
<section>
<div class = "scrollWrapper">
<table>
<tr>
<th>Job ID</th>
<th>Date</th>
<th>Description</th>
</tr>
<tr>
<td><output name="o_jobid" style="width:100px; height:20px"></output></td>
<td><output name="o_date" style="width:100px; height:20px"></output></td>
<td><output name="o_description" style="width:100px; height:20px"></output></td>
</tr>
</table>
</div>
</section>
<section id = "sec2">
<p>Job ID:</p><input type="text" name="jobid"><br>
<p>Date:</p><input type="text" name="date"><br>
<p>Description:</p> <input type="text" name="description"><br>
<br>
<input type="submit" value="Submit">
</section>
</form>
</body>
</html>
I have placed the form outside of the sections in order for the output elements to work and added a display function in the forms onsubmit method.
The display function basically adds the users input in the corresponding output elements. (return false) is only so the form doens't actually submit it's data to the browser.
For browser support, the output element is supported by most modern browser (Chrome 13+, Firefox 6+, IE10+).
If you need support for a wider range you need to change the display function and the output elements.
Hope it helps.

Inclusion of HTML into another page on the same site?

I have an HTML webpage with a specialized purpose. However, I also have a HTML page with a generic set of actions used elsewhere in my site/app.
Specific Page
<html>
<head><title>Specific Page</title></head>
<body>
<h1>My Specific Action</h1>
<div id="NameAction">
<!-- Action HTML goes here... -->
</div>
</body>
</html>
Generic Action
<html>
<body>
Please tell me your name...
<input id="NameText" type="text" size="50" />
<input id="NameSubmit" type="submit" />
</body>
</html>
The question is, I would like to inject the Generic Action HTML into the NameAction div in the Specific Page. What are some ways I would go about doing this?
Use an iframe
<html>
<head><title>Specific Page</title></head>
<body>
<h1>My Specific Action</h1>
<div id="NameAction">
<iframe src="Path-to-generic-html" />
</div>
</body>
</html>
You could use an iframe, which is a way to embed one html document into another, however this makes it difficult for the two html fragments to interact on the front end (Javascript, etc.). Depending on what templating engine you're using (jsp, php, asp) you should be able to include html fragment into a page as follows (server side include):
Generic Action Fragment
Please tell me your name...
<input id="NameText" type="text" size="50" />
<input id="NameSubmit" type="submit" />
Specific Page
<html>
<head><title>Specific Page</title></head>
<body>
<h1>My Specific Action</h1>
<div id="NameAction">
<% include generic action fragment here using engine specific code %>
</div>
</body>
</html>