PDA

View Full Version : how to format the text in mailto


kamarthi7
11-05-2002, 02:02 PM
hello,

I could send the text entered by the user to my mail id by using the mailto function. but how could I format the text like the simple code is below

<html>
<body>
<form name="form1" method="post" action="mailto:kamarthi7@hotmail.com" enctype="text/plain">
<BR> FIRST NAME <input type="text" name="FIRSTNAME">
<BR> SECOND NAME <input type="text" name="SECONDNAME">
<BR> SUBJECT <input type="text" name="SUBJECT">
<BR> DETAILS<BR> <TEXTAREA NAME= "DETAILS" rows = 12 cols = 25> </TEXTAREA>
<BR><input type="submit" name="SUBMIT">

</form>
</body>
</html>

when I enter the text in the input fields i get the result to my mail like this

FIRSTNAME=akash
SECONDNAME=varma
SUBJECT=help
DETAILS=this is a text
and in the second line

special characters üöä


I want to format the text before it is sent to the mail like I want to put a line gap between subject and details.

I want to format the text like change the ü charecter to oa.

so is it posible to format it.
thank you,

krycek
11-05-2002, 03:04 PM
well for a start that aint JavaScript, it's HTML... but I dunno if it's better off here or not! :)

why not just add an extra <br> if you want that linespace?

and also, your names should NEVER include spaces! Proper naming convention would be:

firstName

OR

first_name

NOT

FIRST NAME

...as to what you are trying to do, I am not entirely sure... try changing the names, and if you don't get the right result, post a more detailed question :)

::] krycek [::

beetle
11-05-2002, 03:08 PM
Nifty tool (http://www.webreference.com/js/column70/3.html) for creating advanced, accurate mailto: links :D

beetle
11-05-2002, 03:22 PM
Oh, wait...I see what you are asking for.

Uh, you can do it with javascript....but you would basically have to combine all the input fields onSubmit, arrange them however you like, add that to a hidden value, then disable the rest of the fields...For example<script>
function doSubmit(f, hField) {
for (var i = 0; i<f.elements.length; i++) {
var e = f.elements[i];
if (/(?:hidden|submit|reset)/i.test(e.type)) break;
f.elements[hField].value += e.name + ": " + e.value + "%0D%0A";
e.disabled = true;
}
return true;
}
</script>

<form name="form1" method="post" onSubmit="return doSubmit(this, 'data')" action="mailto:kamarthi7@hotmail.com" enctype="text/plain">
<input type="text" name="First_Name" />
<input type="text" name="Last_Name" />
<input type="hidden" name="data" value="" />
<input type="submit" value="Submit" />
</form>

kamarthi7
11-05-2002, 04:14 PM
sorry,

now i made the changes, hop its clear now.