Forum Moderators: open
i'm getting trouble about this :
there's a webpage where we should fill "name, address, email address, etc" to contact the company
the company asked me to submit the form data into a text file but the page is still as HTML
but i really don't know how to do this
i surfed this forum and found something similar to "saving data" but there was only about saving data in client's computer
how about saving data in the web server?
can someone help me?
i need it immediately
thanks
it was really a blur to me when my supervisor asked me to save the form data not to a database, but only in text and he said it was no programming inside
is what he said true? what should i do?
does dreamweaver have a tool to do that?
as long as i know, dreamweaver doesn't have any tools like that
i rethought about it and maybe this one is the one he wanted since i haven't get a chance to meet him
after we click the submit button, the page will create an email notification, just name it username@domain.com
can javascript make a package of email?
but i'm not sure who the sender is since it's only a button
what does a website usually do when we need to make a notification to a certain email address?
JavaScript can also compose an email, consider the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function sendMail(_frm){
var eml="you@youraddress.com";
var bod="&body="+_frm.selOne.value+" ¦¦ "+_frm.txtOne.value;
var subj="?subject=Whatever you want";
document.location="mailto:"+eml+subj+bod;
}
</script>
</head>
<body>
<form action="mailto:you@youraddress.com" enctype="text/plain"
method="POST" onsubmit="sendMail(this);return false;">
<select name="selOne">
<option value="Dog">Dog</option>
<option value="Cat">Cat</option>
</select>
<textarea name="txtOne"></textarea>
<input type="submit" value="Submit" />
</form>
</body>
</html>
Bear in mind that using JavaScript alone helps circumvent email-adddress-harvesting robots. The above uses JavaScript, but includes a mailto: as a backup for those who may have JavaScript turned off.
As regards saving a text file with client-side JavaScript: while JS cannot access the local file system to save a file, it can create a window with just the text file as content and the user can employ the browser's "File - Save [Page] As" menu options.