Ir para conteúdo
marfegte

codigo javascript gerador de lista xml

Recommended Posts

eu tenho um codigo pra gera lista em xml
nao to conseguindo salva o codigo gerado no servidor e deixar ele gravado na tabela no site para editor

https://codepen.io/marfegte/pen/mWXzBG


index.html

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Gerador lista xml</title>
<link rel="stylesheet" type="text/css" media="all" href="generator.css" />
<script src="codigo.js" type="text/javascript"></script>
</head>
<body onload="init()">

		
		<h1><a href="http://playlist-generator.com/"></a>IPTV Gerador Lista xml</h1>
		<noscript><p id="no_javascript">IPTV Gerador Lista xml usado JavaScript</p></noscript>
		<form id="playlistform" action="" onsubmit="return false;">
			<table>
				<thead>
					<tr>
						<th>Titulo</th>
						<th>Link</th>
						<th>Thumbnail</th>
						<th>Fanart</th>
						<th>Info</th>
						
						<th><span class="desc" title="duration (in milliseconds)">Opção</span></th>
					</tr>
				</thead>
				<tbody id="playlist"></tbody>
			</table>
		</form>
		
		<p style="margin-top: 3em;">playlist.xml</p>

		<pre id="playlistcode"></pre>

</body>
</html>

codigo.js

var TYPE_TITLE = 0;
var TYPE_LINK = 1;
var TYPE_THUMBNAIL = 2;
var TYPE_FANART = 3;
var TYPE_INFO = 4;
var COUNT_COLUMNS = 6;

function htmlentities(str) {
	str = str.replace(/&/g, "&amp;");
	str = str.replace(/"/g, "&quot;");
	str = str.replace(/</g, "&lt;");
	str = str.replace(/>/g, "&gt;");
	return str;
}
function nl2br(str) {
	str = str.replace(/\n/g, "<br/>");
	return str;
}
function update() {
	var playlist = document.getElementById("playlist");
	var rows = playlist.getElementsByTagName("tr");	
	var code = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
	code += "  \n";	
	for (var index = 0; index < rows.length; index++) {
		var inputFields = rows[index].getElementsByTagName("input");		
		code += "    <item>\n";		
		for (var j = 0; j < inputFields.length; j++) {			
			var type = "";
			var value = inputFields[j].value;			
			switch (j) {
			case TYPE_TITLE:
				type = "title";
				break;
			case TYPE_LINK:
				type = "link";
				break;
			case TYPE_THUMBNAIL:
				type = "thumbnail";
				break;
			case TYPE_FANART:
				type = "fanart";
				break;
			case TYPE_INFO:
				type = "info";
				break;
			
			}
			
			if (type == "link" || value != "") {
				code += "      <" + type + ">" + htmlentities(value) + "</" + type + ">\n";
			}
			
		}		
		code += "    </item>\n";
		code += "    \n";
	}	
	document.getElementById("playlistcode").innerHTML = nl2br(htmlentities(code));
}

function updateTable() {
	$("#results").html('')
 
	
	var playlist = document.getElementById("playlist");
	var rows = playlist.getElementsByTagName("tr");	
	for (var index = 0; index < rows.length; index++) {
		var row = rows[index];
		var cols = row.getElementsByTagName("td");	
		var content = "<a href=\"#\" title=\"adicionar um novo\" onclick=\"addTrack(" + (index + 1) + "); return false;\">Adicionar</a> <a href=\"#\" title=\"remove this track\" onclick=\"removeTrack(" + index + "); return false;\">Apagar</a>";
		cols[cols.length - 1].innerHTML = content;
	}
}
function addTrack(index) {
	var playlist = document.getElementById("playlist");
	var rows = playlist.getElementsByTagName("tr");	
	var newRow = document.createElement("tr");
	for (var i = 0; i < COUNT_COLUMNS; i++) {
		var newColumn = document.createElement("td");		
		if (i < COUNT_COLUMNS - 1) {
			
			var inputField = document.createElement("input");
			inputField.setAttribute("type", "text");
			inputField.onchange = update;
			inputField.onkeyup = update;
			newColumn.appendChild(inputField);
		} else {			
			newColumn.setAttribute("class", "options");
		}		
		newRow.appendChild(newColumn);
	}
	
	if (index == rows.length) {
		playlist.appendChild(newRow);
	} else {
		playlist.insertBefore(newRow, rows[index]);
	}	
	updateTable();
	update();
}
function removeTrack(index) {
	var playlist = document.getElementById("playlist");
	var rows = playlist.getElementsByTagName("tr");
	
	if (rows.length > 1 && window.confirm("Tem certeza que deseja apagar?")) {
		playlist.removeChild(rows[index]);		
		updateTable();
		update();
	}
}

function init() {
	addTrack(0);
	document.getElementById("playlist").getElementsByTagName("tr")[0].getElementsByTagName("input")[0].value = "";
	update();
}

generator.css

body, td {
	font-family: Verdana, Arial, sans-serif;
	font-size: 10pt;
}

a {
	color: #0000ff;
}

a:hover {
	color: #6666ff;
}

#no_javascript {
	background-color: #cc0000;
	color: #ffffff;
	padding: 0.5em;
	border: 2px dashed #000000;
}

h1 {
	font-size: 150%;
	font-weight: bold;
}

h2 {
	margin-top: 1em;
	font-size: 120%;
	font-weight: bold;
}

table {
	width: 100%;
	margin-top: 1em;
}

th {
	font-size: 100%;
	font-weight: bold;
	text-align: center;
	background-color: #ccccff;
	padding: 0.1em 0.3em 0.1em 0.3em;
	border: 1px solid #aaaaff;
}

td {
	padding: 0;
	text-align: center;
	border: 1px solid #660000;
}

td input {
	width: 100%;
	height: 100%;
	border: 0;
	background-color: #ffffff;
}

td input:hover {
	background-color: #eeeeff;
}

td input:focus {
	background-color: #ddddff;
}

#playlistcode {
	background-color: #ccccff;
	padding: 0.3em;
	border: 1px solid #aaaaff;
	font-size: 10pt;
	font-family: "Courier New",Verdana,sans-serif;
}

.desc {
	border-bottom: 
}

.options {
	white-space: nowrap;
	background-color: #ccccff;
	padding: 0.3em;
	font-weight: bold;
	border: 1px solid #aaaaff;
	font-size: 10pt;
	text-align: center;
	font-family: "Verdana,sans-serif;
	
}

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

No console do navegador está dando alguma mensagem de erro?

Ou o erro está no envio para o servidor?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar Agora


  • Conteúdo Similar

    • Por wilsonguns
      Boa noite,
       
      Venho estudando o desenvolvimento de aplicações PHP através de servidor web local, porém estou a procura de um serviço no qual posso publicar a aplicações web PHP.
      Que tipo de serviço devo utilizar? 
      O serviço seria daqueles que publicam sites ou do tipo computação em nuvem onde posso instalar e configurar servidores como se estivessem em meu disco local?
    • Por robertoPedro
      Gostaria muito de fazer uma barra de porcentagem no meu sistema, mas não encontrei algum exemplo. Alquém sabe uma maneira fácil de fazer?
      Se não for muito abuso, teria como fazer uma barra circular tipo a da foto:

    • Por robertoPedro
       
      Estava tentando utilizar um código já pronto, mas a parte de drag-n-drop de javascript não está funcionando. Tem como arrumar? Desculpe não tenho muitos conhecimentos sobre o assunto, porém queria muito fazer com que esse código funciona-se na minha máquina.
      <!DOCTYPE html> <html dir="ltr" lang="pt-BR"> <head> <meta charset="UTF-8" /> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script> $(function () { var kanbanCol = $('.panel-body'); kanbanCol.css('max-height', (window.innerHeight - 150) + 'px'); var kanbanColCount = parseInt(kanbanCol.length); $('.container-fluid').css('min-width', (kanbanColCount * 350) + 'px'); draggableInit(); $('.panel-heading').click(function() { var $panelBody = $(this).parent().children('.panel-body'); $panelBody.slideToggle(); }); }); function draggableInit() { var sourceId; $('[draggable=true]').bind('dragstart', function (event) { sourceId = $(this).parent().attr('id'); event.originalEvent.dataTransfer.setData("text/plain", event.target.getAttribute('id')); }); $('.panel-body').bind('dragover', function (event) { event.preventDefault(); }); $('.panel-body').bind('drop', function (event) { var children = $(this).children(); var targetId = children.attr('id'); if (sourceId != targetId) { var elementId = event.originalEvent.dataTransfer.getData("text/plain"); $('#processing-modal').modal('toggle'); //before post // Post data setTimeout(function () { var element = document.getElementById(elementId); children.prepend(element); $('#processing-modal').modal('toggle'); // after post }, 1000); } event.preventDefault(); }); } </script> <style><?php include 'estilo.css'; ?></style> </head> <body> <div class="container-fluid"> <div id="sortableKanbanBoards" class="row"> <!--sütun başlangıç--> <div class="panel panel-primary kanban-col"> <div class="panel-heading"> TODO <i class="fa fa-2x fa-plus-circle pull-right"></i> </div> <div class="panel-body"> <div id="TODO" class="kanban-centered"> <article class="kanban-entry grab" id="item1" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Art Ramadani</a> <span>posted a status update</span></h2> <p>Tolerably earnestly middleton extremely distrusts she boy now not. Add and offered prepare how cordial two promise. Greatly who affixed suppose but enquire compact prepare all put. Added forth chief trees but rooms think may.</p> </div> </div> </article> <article class="kanban-entry grab" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Job Meeting</a></h2> <p>You have a meeting at <strong>Laborator Office</strong> Today.</p> </div> </div> </article> <article class="kanban-entry grab" id="item3" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Arlind Nushi</a> <span>checked in at</span> <a href="#">Laborator</a></h2> <blockquote>Great place, feeling like in home.</blockquote> <div id="sample-checkin" class="map-checkin" style="height: 170px; width: 100%; position: relative; background-color: rgb(229, 227, 223); overflow: hidden; -webkit-transform: translateZ(0);"><div class="gm-style" style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0;"><div style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0;"><div style="position: absolute; left: 0px; top: 0px; z-index: 1; width: 100%; cursor: url(http://maps.gstatic.com/mapfiles/openhand_8_8.cur) 8 8, default; -webkit-transform-origin: 0px 0px; -webkit-transform: matrix(1, 0, 0, 1, 0, 0);"><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; width: 100%; z-index: 200;"><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; z-index: 101; width: 100%;"></div></div><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; width: 100%; z-index: 201;"><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; z-index: 102; width: 100%;"></div><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; z-index: 103; width: 100%;"><div style="position: absolute; left: 0px; top: 0px; z-index: -1;"><div style="position: absolute; left: 0px; top: 0px; z-index: 1;"><div style="width: 256px; height: 256px; overflow: hidden; -webkit-transform: translateZ(0); position: absolute; left: 72px; top: -176px;"><canvas draggable="false" height="256" width="256" style="-webkit-user-select: none; position: absolute; left: 0px; top: 0px; height: 256px; width: 256px;"></canvas></div><div style="width: 256px; height: 256px; overflow: hidden; -webkit-transform: translateZ(0); position: absolute; left: 72px; top: 80px;"></div><div style="width: 256px; height: 256px; overflow: hidden; -webkit-transform: translateZ(0); position: absolute; left: -184px; top: -176px;"></div><div style="width: 256px; height: 256px; overflow: hidden; -webkit-transform: translateZ(0); position: absolute; left: -184px; top: 80px;"></div><div style="width: 256px; height: 256px; overflow: hidden; -webkit-transform: translateZ(0); position: absolute; left: 328px; top: -176px;"></div><div style="width: 256px; height: 256px; overflow: hidden; -webkit-transform: translateZ(0); position: absolute; left: 328px; top: 80px;"></div></div></div></div></div><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; width: 100%; z-index: 202;"><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; z-index: 104; width: 100%;"></div><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; z-index: 105; width: 100%;"></div><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; z-index: 106; width: 100%;"></div></div><div style="-webkit-transform: translateZ(0); position: absolute; left: 0px; top: 0px; z-index: 100; width: 100%;"><div style="position: absolute; left: 0px; top: 0px; z-index: 0;"><div style="position: absolute; left: 0px; top: 0px; z-index: 1;"><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 72px; top: -176px;"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 72px; top: 80px;"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: -184px; top: -176px;"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: -184px; top: 80px;"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 328px; top: -176px;"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 328px; top: 80px;"></div></div></div></div><div style="position: absolute; z-index: 0; left: 0px; top: 0px;"><div style="overflow: hidden; width: 431px; height: 170px;"><img src="http://maps.googleapis.com/maps/api/js/StaticMapService.GetMapImage?1m2&1i701363&2i1636267&2e1&3u14&4m2&1u431&2u170&5m4&1e0&5spt-BR&6sus&10b1&token=8503" style="width: 421px; height: 160px;"></div></div><div style="position: absolute; left: 0px; top: 0px; z-index: 0;"><div style="position: absolute; left: 0px; top: 0px; z-index: 1;"><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 72px; top: -176px; opacity: 1; transition: opacity 200ms ease-out; -webkit-transition: opacity 200ms ease-out;"><img src="http://mt0.googleapis.com/vt?lyrs=m@248313357&src=apiv3&hl=pt-BR&x=2740&y=6391&z=14&style=47,37%7Csmartmaps" draggable="false" style="width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; -webkit-transform: translateZ(0);"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 72px; top: 80px; opacity: 1; transition: opacity 200ms ease-out; -webkit-transition: opacity 200ms ease-out;"><img src="http://mt0.googleapis.com/vt?lyrs=m@248254527&src=apiv3&hl=pt-BR&x=2740&y=6392&z=14&style=47,37%7Csmartmaps" draggable="false" style="width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; -webkit-transform: translateZ(0);"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: -184px; top: -176px; opacity: 1; transition: opacity 200ms ease-out; -webkit-transition: opacity 200ms ease-out;"><img src="http://mt1.googleapis.com/vt?lyrs=m@248282439&src=apiv3&hl=pt-BR&x=2739&y=6391&z=14&style=47,37%7Csmartmaps" draggable="false" style="width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; -webkit-transform: translateZ(0);"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: -184px; top: 80px; opacity: 1; transition: opacity 200ms ease-out; -webkit-transition: opacity 200ms ease-out;"><img src="http://mt1.googleapis.com/vt?lyrs=m@248011677&src=apiv3&hl=pt-BR&x=2739&y=6392&z=14&style=47,37%7Csmartmaps" draggable="false" style="width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; -webkit-transform: translateZ(0);"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 328px; top: -176px; opacity: 1; transition: opacity 200ms ease-out; -webkit-transition: opacity 200ms ease-out;"><img src="http://mt1.googleapis.com/vt?lyrs=m@248301220&src=apiv3&hl=pt-BR&x=2741&y=6391&z=14&style=47,37%7Csmartmaps" draggable="false" style="width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; -webkit-transform: translateZ(0);"></div><div style="width: 256px; height: 256px; -webkit-transform: translateZ(0); position: absolute; left: 328px; top: 80px; opacity: 1; transition: opacity 200ms ease-out; -webkit-transition: opacity 200ms ease-out;"><img src="http://mt1.googleapis.com/vt?lyrs=m@248301220&src=apiv3&hl=pt-BR&x=2741&y=6392&z=14&style=47,37%7Csmartmaps" draggable="false" style="width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; -webkit-transform: translateZ(0);"></div></div></div></div></div><div style="margin-left: 5px; margin-right: 5px; z-index: 1000000; position: absolute; left: 0px; bottom: 0px;"><a target="_blank" href="http://maps.google.com/maps?ll=36.738888,-119.783013&z=14&t=m&hl=pt-BR&gl=US&mapclient=apiv3" title="Clique para ver esta área no Google Maps" style="position: static; overflow: visible; float: none; display: inline;"><div style="width: 62px; height: 26px; cursor: pointer;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/google_white2.png" draggable="false" style="position: absolute; left: 0px; top: 0px; width: 62px; height: 26px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div></a></div><div class="gmnoprint" style="z-index: 1000001; position: absolute; right: 192px; bottom: 0px; width: 85px;"><div draggable="false" class="gm-style-cc" style="-webkit-user-select: none;"><div style="opacity: 0.7; width: 100%; height: 100%; position: absolute;"><div style="width: 1px;"></div><div style="background-color: rgb(245, 245, 245); width: auto; height: 100%; margin-left: 1px;"></div></div><div style="position: relative; padding-right: 6px; padding-left: 6px; font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); white-space: nowrap; direction: ltr; text-align: right;"><a style="color: rgb(68, 68, 68); text-decoration: none; cursor: pointer;">Dados do mapa</a><span style="display: none;">Dados cartográficos ©2014 Google</span></div></div></div><div style="background-color: white; padding: 15px 21px; border: 1px solid rgb(171, 171, 171); font-family: Roboto, Arial, sans-serif; color: rgb(34, 34, 34); -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 16px; box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 16px; z-index: 10000002; display: none; width: 256px; height: 118px; position: absolute; left: 61px; top: 5px;"><div style="padding: 0px 0px 10px; font-size: 16px;">Dados do mapa</div><div style="font-size: 13px;">Dados cartográficos ©2014 Google</div><div style="width: 13px; height: 13px; overflow: hidden; position: absolute; opacity: 0.7; right: 12px; top: 12px; z-index: 10000; cursor: pointer;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/mapcnt3.png" draggable="false" style="position: absolute; left: -2px; top: -336px; width: 59px; height: 492px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div></div><div class="gmnoscreen" style="position: absolute; right: 0px; bottom: 0px;"><div style="font-family: Roboto, Arial, sans-serif; font-size: 11px; color: rgb(68, 68, 68); direction: ltr; text-align: right; background-color: rgb(245, 245, 245);">Dados cartográficos ©2014 Google</div></div><div class="gmnoprint gm-style-cc" draggable="false" style="z-index: 1000001; position: absolute; -webkit-user-select: none; right: 113px; bottom: 0px;"><div style="opacity: 0.7; width: 100%; height: 100%; position: absolute;"><div style="width: 1px;"></div><div style="background-color: rgb(245, 245, 245); width: auto; height: 100%; margin-left: 1px;"></div></div><div style="position: relative; padding-right: 6px; padding-left: 6px; font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); white-space: nowrap; direction: ltr; text-align: right;"><a href="http://www.google.com/intl/pt-BR_US/help/terms_maps.html" target="_blank" style="text-decoration: none; cursor: pointer; color: rgb(68, 68, 68);">Termos de Uso</a></div></div><div draggable="false" class="gm-style-cc" style="-webkit-user-select: none; position: absolute; right: 0px; bottom: 0px;"><div style="opacity: 0.7; width: 100%; height: 100%; position: absolute;"><div style="width: 1px;"></div><div style="background-color: rgb(245, 245, 245); width: auto; height: 100%; margin-left: 1px;"></div></div><div style="position: relative; padding-right: 6px; padding-left: 6px; font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); white-space: nowrap; direction: ltr; text-align: right;"><a target="_new" title="Informar erros no mapa ou nas imagens para o Google" href="http://maps.google.com/maps?ll=36.738888,-119.783013&z=14&t=m&hl=pt-BR&gl=US&mapclient=apiv3&skstate=action:mps_dialog$apiref:1&output=classic" style="font-family: Roboto, Arial, sans-serif; font-size: 10px; color: rgb(68, 68, 68); text-decoration: none; position: relative;">Informar erro no mapa</a></div></div><div class="gmnoprint" draggable="false" controlwidth="32" controlheight="84" style="margin: 5px; -webkit-user-select: none; position: absolute; left: 0px; top: 0px;"><div controlwidth="32" controlheight="40" style="cursor: url(http://maps.gstatic.com/mapfiles/openhand_8_8.cur) 8 8, default; position: absolute; left: 0px; top: 0px;"><div style="width: 32px; height: 40px; overflow: hidden; position: absolute; left: 0px; top: 0px;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/cb_scout2.png" draggable="false" style="position: absolute; left: -9px; top: -102px; width: 1028px; height: 214px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div><div style="width: 32px; height: 40px; overflow: hidden; position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/cb_scout2.png" draggable="false" style="position: absolute; left: -107px; top: -102px; width: 1028px; height: 214px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div><div style="width: 32px; height: 40px; overflow: hidden; position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/cb_scout2.png" draggable="false" style="position: absolute; left: -58px; top: -102px; width: 1028px; height: 214px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div><div style="width: 32px; height: 40px; overflow: hidden; position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/cb_scout2.png" draggable="false" style="position: absolute; left: -205px; top: -102px; width: 1028px; height: 214px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div></div><div class="gmnoprint" controlwidth="0" controlheight="0" style="opacity: 0.6; display: none; position: absolute;"><div title="Girar o mapa em 90 graus" style="width: 22px; height: 22px; overflow: hidden; position: absolute; cursor: pointer;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/mapcnt3.png" draggable="false" style="position: absolute; left: -38px; top: -360px; width: 59px; height: 492px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div></div><div class="gmnoprint" controlwidth="20" controlheight="39" style="position: absolute; left: 6px; top: 45px;"><div style="width: 20px; height: 39px; overflow: hidden; position: absolute;"><img src="http://maps.gstatic.com/mapfiles/api-3/images/mapcnt3.png" draggable="false" style="position: absolute; left: -39px; top: -401px; width: 59px; height: 492px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"></div><div title="Aumentar o zoom" style="position: absolute; left: 0px; top: 2px; width: 20px; height: 17px; cursor: pointer;"></div><div title="Diminuir o zoom" style="position: absolute; left: 0px; top: 19px; width: 20px; height: 17px; cursor: pointer;"></div></div></div><div class="gmnoprint" style="margin: 5px; z-index: 0; position: absolute; cursor: pointer; right: 0px; top: 0px;"><div class="gm-style-mtc" style="float: left;"><div draggable="false" title="Mostrar mapa de ruas" style="direction: ltr; overflow: hidden; text-align: center; position: relative; color: rgb(0, 0, 0); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; background-color: rgb(255, 255, 255); padding: 1px 6px; border-bottom-left-radius: 2px; border-top-left-radius: 2px; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid rgba(0, 0, 0, 0.14902); -webkit-box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; min-width: 28px; font-weight: 500;">Mapa</div><div style="background-color: white; z-index: -1; padding-top: 2px; -webkit-background-clip: padding-box; background-clip: padding-box; border-width: 0px 1px 1px; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: rgba(0, 0, 0, 0.14902); border-bottom-color: rgba(0, 0, 0, 0.14902); border-left-color: rgba(0, 0, 0, 0.14902); -webkit-box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; position: absolute; left: 0px; top: 19px; text-align: left; display: none;"><div draggable="false" title="Mostrar mapa de ruas com terreno" style="color: rgb(0, 0, 0); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; background-color: rgb(255, 255, 255); padding: 3px 8px 3px 5px; direction: ltr; text-align: left; white-space: nowrap;"><span role="checkbox" style="box-sizing: border-box; position: relative; line-height: 0; font-size: 0px; margin: 0px 5px 0px 0px; display: inline-block; background-color: rgb(255, 255, 255); border: 1px solid rgb(198, 198, 198); border-top-left-radius: 1px; border-top-right-radius: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; width: 13px; height: 13px; vertical-align: middle;"><div style="position: absolute; left: 1px; top: -2px; width: 13px; height: 11px; overflow: hidden; display: none;"><img src="http://maps.gstatic.com/mapfiles/mv/imgs8.png" draggable="false" style="position: absolute; left: -52px; top: -44px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; width: 68px; height: 67px;"></div></span><label style="vertical-align: middle; cursor: pointer;">Terreno</label></div></div></div><div class="gm-style-mtc" style="float: left;"><div draggable="false" title="Mostrar imagens de satélite" style="direction: ltr; overflow: hidden; text-align: center; position: relative; color: rgb(86, 86, 86); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; background-color: rgb(255, 255, 255); padding: 1px 6px; border-bottom-right-radius: 2px; border-top-right-radius: 2px; -webkit-background-clip: padding-box; background-clip: padding-box; border-width: 1px 1px 1px 0px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: rgba(0, 0, 0, 0.14902); border-right-color: rgba(0, 0, 0, 0.14902); border-bottom-color: rgba(0, 0, 0, 0.14902); -webkit-box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; min-width: 36px;">Satélite</div><div style="background-color: white; z-index: -1; padding-top: 2px; -webkit-background-clip: padding-box; background-clip: padding-box; border-width: 0px 1px 1px; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: rgba(0, 0, 0, 0.14902); border-bottom-color: rgba(0, 0, 0, 0.14902); border-left-color: rgba(0, 0, 0, 0.14902); -webkit-box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px; position: absolute; right: 0px; top: 19px; text-align: left; display: none;"><div draggable="false" title="Aumentar o zoom para a visualização de 45 graus" style="color: rgb(184, 184, 184); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; background-color: rgb(255, 255, 255); padding: 3px 8px 3px 5px; direction: ltr; text-align: left; white-space: nowrap; display: none;"><span role="checkbox" style="box-sizing: border-box; position: relative; line-height: 0; font-size: 0px; margin: 0px 5px 0px 0px; display: inline-block; background-color: rgb(255, 255, 255); border: 1px solid rgb(241, 241, 241); border-top-left-radius: 1px; border-top-right-radius: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; width: 13px; height: 13px; vertical-align: middle;"><div style="position: absolute; left: 1px; top: -2px; width: 13px; height: 11px; overflow: hidden; display: none;"><img src="http://maps.gstatic.com/mapfiles/mv/imgs8.png" draggable="false" style="position: absolute; left: -52px; top: -44px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; width: 68px; height: 67px;"></div></span><label style="vertical-align: middle; cursor: pointer;">45°</label></div><div draggable="false" title="Mostrar imagens com nomes de rua" style="color: rgb(0, 0, 0); font-family: Roboto, Arial, sans-serif; -webkit-user-select: none; font-size: 11px; background-color: rgb(255, 255, 255); padding: 3px 8px 3px 5px; direction: ltr; text-align: left; white-space: nowrap;"><span role="checkbox" style="box-sizing: border-box; position: relative; line-height: 0; font-size: 0px; margin: 0px 5px 0px 0px; display: inline-block; background-color: rgb(255, 255, 255); border: 1px solid rgb(198, 198, 198); border-top-left-radius: 1px; border-top-right-radius: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; width: 13px; height: 13px; vertical-align: middle;"><div style="position: absolute; left: 1px; top: -2px; width: 13px; height: 11px; overflow: hidden;"><img src="http://maps.gstatic.com/mapfiles/mv/imgs8.png" draggable="false" style="position: absolute; left: -52px; top: -44px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px; width: 68px; height: 67px;"></div></span><label style="vertical-align: middle; cursor: pointer;">Marcadores</label></div></div></div></div></div></div> </div> </div> </article> <article class="kanban-entry grab" id="item4" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Arber Nushi</a> <span>changed his</span> <a href="#">Profile Picture</a></h2> <blockquote>Pianoforte principles our unaffected not for astonished travelling are particular.</blockquote> <img src="http://themes.laborator.co/neon/assets/images/timeline-image-3.png" class="img-responsive img-rounded full-width"> </div> </div> </article> </div> </div> <div class="panel-footer"> <a href="#">Add a card...</a> </div> </div> <!--sütun bitiş--> <!--sütun başlangıç--> <div class="panel panel-primary kanban-col"> <div class="panel-heading"> DOING <i class="fa fa-2x fa-plus-circle pull-right"></i> </div> <div class="panel-body"> <div id="DOING" class="kanban-centered"> <article class="kanban-entry grab" id="item5" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Art Ramadani</a> <span>posted a status update</span></h2> <p>Tolerably earnestly middleton extremely distrusts she boy now not. Add and offered prepare how cordial two promise. Greatly who affixed suppose but enquire compact prepare all put. Added forth chief trees but rooms think may.</p> </div> </div> </article> <article class="kanban-entry grab" id="item6" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Job Meeting</a></h2> <p>You have a meeting at <strong>Laborator Office</strong> Today.</p> </div> </div> </article> </div> </div> <div class="panel-footer"> <a href="#">Add a card...</a> </div> </div> <!--sütun bitiş--> <!--sütun başlangıç--> <div class="panel panel-primary kanban-col"> <div class="panel-heading"> DONE <i class="fa fa-2x fa-plus-circle pull-right"></i> </div> <div class="panel-body"> <div id="DONE" class="kanban-centered"> <article class="kanban-entry grab" id="item5" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Art Ramadani</a> <span>posted a status update</span></h2> <p>Tolerably earnestly middleton extremely distrusts she boy now not. Add and offered prepare how cordial two promise. Greatly who affixed suppose but enquire compact prepare all put. Added forth chief trees but rooms think may.</p> </div> </div> </article> <article class="kanban-entry grab" id="item6" draggable="true"> <div class="kanban-entry-inner"> <div class="kanban-label"> <h2><a href="#">Job Meeting</a></h2> <p>You have a meeting at <strong>Laborator Office</strong> Today.</p> </div> </div> </article> </div> </div> <div class="panel-footer"> <a href="#">Add a card...</a> </div> </div> </div> </div> <!-- Static Modal --> <div class="modal modal-static fade" id="processing-modal" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <div class="text-center"> <i class="fa fa-refresh fa-5x fa-spin"></i> <h4>Processing...</h4> </div> </div> </div> </div> </div> </body> </html>  
    • Por Marcelo Schirbel
      Olá a todos!

      Sou iniciante em javascript, portanto tenham paciência!
      Gostaria de saber como desenvolver um javascript que pegasse os dados de um formulario html e os transformasse em um arquivo txt, que pudesse ser aberto pelo notepad. Sendo que, esse arquivo notepad deves ser renomeado com um dos campos do formulário. Alguem pode me indicar algum lugar onde posso encontrar essas informações?

      Desde já, muito obrigado!
    • Por juliocesarpt
      O que eu queria que acontecesse, que o formulário validasse meus campos, ai em seguida quando eu clicar em entrar, me redirecionar para o site desejado,
      mas não é isso que acontecesse, quando clico em entrar já me redirecionar sem validar os campos.
      Já tentei com onSubmit, agora com onClick, sem os 2 e nada, estou fazendo algo errado e alguém puder me ajudar, ficaria muito grato!
       
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
          <title>ChipStore - Principal</title>
           <meta charset="utf-8">
          <meta name="viewport" content="width=device-width, initial-scale=1">
          <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
          <link href="https://fonts.googleapis.com/css?family=Aldrich" rel="stylesheet" type="text/css">
          <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
          <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
          <link href="https://fonts.googleapis.com/css?family=Rajdhani" rel="stylesheet">
          <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
          <link rel="shortcut icon" href="./img/favicon.ico">
          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
          <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
          <script type="text/javascript">
          function verificaPessoa() {
          if (document.getElementById('tipoPessoa').value == 'PF') {
              document.getElementById('pessoaFisica').style.display = 'block';
              document.getElementById('pessoaJuridica').style.display = 'none';
          } else {
              document.getElementById('pessoaFisica').style.display = 'none';
              document.getElementById('pessoaJuridica').style.display = 'block';
          }
      }
      <!---------------  -------------------->
          function Enviar(opc) {
          if(opc == 1) {
              document.form.action = "https://oglobo.globo.com/";
              document.form.target = "";
              document.form.submit();
          } if(opc == 0) {
              document.form.action = "https://extra.globo.com/";
              document.form.target = "";
              document.form.submit();
          }
      }
          </script>
      </head>
      <body>
          <nav class="navbar navbar-inverse navbar-fixed-top custom">
              <div class="container-fluid">
                  <div class="navbar-header">
                      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                          <span class="sr-only">Alternar Navegação</span>
                          <span class="icon-bar"></span>
                          <span class="icon-bar"></span>
                          <span class="icon-bar"></span>
                      </button>
                  </div>
                  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                      <div class="col-sm-3">
                          <button type="button" class="btn btn-default navbar-btn" data-toggle="modal" data-target="#login" id="nav-btn-login">LOGIN</button>
                          <i class="glyphicon glyphicon-shopping"></i>
                      </div>
                  </div>
              </div>
          </nav>
          
          <!--------------- MODAL LOGIN -------------------->
          <div class="modal fade" id="login" role="dialog">
              <div class="modal-dialog" role="document">
                  <div class="modal-content" id="modalLogin">
                      <div class="modal-header">
                          <h1 class="text-center"><i class="glyphicon glyphicon-user"></i> Login</h1>
                      </div>
                      <div class="modal-body">
                          <form action="" method="POST" name="form" target="" id="form" onSubmit="">
                            Login:
                      <select id="tipoPessoa" name="tipoPessoa" onchange="verificaPessoa();">
                         <option value="PF">Cliente</option>
                         <option value="PJ">Administrador</option>
                      </select>
                        <br>
                        <br>
                  <div id="pessoaFisica" style="display:block;">
                              <div class="form-group">
                                  <label for="exampleInputEmail1">Email</label>
                                  <input type="email" class="form-control" name="logincli" id="loginCli" placeholder="Digite seu Email" required autofocus />
                              </div>
                              <div class="form-group">
                                  <label for="exampleInputPassword1">Senha</label>
                                  <input type="password" class="form-control" name="cp1" id="cp1" placeholder="Digite sua senha" required autofocus />
                              </div>
                          <button name="visualizar" class="btn btn-form btn-block" type="submit" id="visualizar" value="Visualizar" onClick="Enviar(1);">Entrar</button>  
                  </div>
                  <div id="pessoaJuridica" style="display:none;">
                                 <div class="form-group">
                                  <label for="exampleInputEmail2">Cpf</label>
                                  <input type="text" class="form-control" name="loginpro" id="loginPro" placeholder="Digite seu Cpf" required autofocus />
                              </div>
                              <div class="form-group">
                                  <label for="exampleInputPassword2">Senha</label>
                                  <input type="password" class="form-control" name="cp2" id="cp2" placeholder="Digite sua senha" required autofocus />
                              </div>
                          <button name="enviar" class="btn btn-form btn-block" type="submit" id="enviar" value="Enviar" onClick="Enviar(0);">Entrar</button>  
                  </div>
                            
                          </form>
                      </div>
                      <div class="modal-footer" style="text-align: center;">
                          <p>Não é cadastrado? <a class="login-link" href="#">Clique aqui!</a></p>
                      </div>
                  </div>
              </div>
          </div>
      </body>
      </html>
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.

Este projeto é mantido e patrocinado pelas empresas:
Hospedado por: