<!DOCTYPE html>
<html>
<head>
<script>
function validateForm() {
var x = document.forms["myForm"]["email"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
alert("Not a valid e-mail address");
return false;
}
}
</script>
</head>
<body>
<form name="myForm" action="/action_page.php" onsubmit="return validateForm();" method="post">
Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>
</html>
Kamis, 21 Desember 2017
Senin, 11 Desember 2017
IT : Export HTML To CSV Without Save
Untuk memakai fasilitas ini pastikan untuk nama table itu sama dengan yang di javascript
Javascript :
var xport = {
_fallbacktoCSV: true,
toXLS: function(tableId, filename) {
this._filename = (typeof filename == 'undefined') ? tableId : filename;
//var ieVersion = this._getMsieVersion();
//Fallback to CSV for IE & Edge
if ((this._getMsieVersion() || this._isFirefox()) && this._fallbacktoCSV) {
return this.toCSV(tableId);
} else if (this._getMsieVersion() || this._isFirefox()) {
alert("Not supported browser");
}
Javascript :
var xport = {
_fallbacktoCSV: true,
toXLS: function(tableId, filename) {
this._filename = (typeof filename == 'undefined') ? tableId : filename;
//var ieVersion = this._getMsieVersion();
//Fallback to CSV for IE & Edge
if ((this._getMsieVersion() || this._isFirefox()) && this._fallbacktoCSV) {
return this.toCSV(tableId);
} else if (this._getMsieVersion() || this._isFirefox()) {
alert("Not supported browser");
}
Langganan:
Postingan (Atom)