Search the Community
Showing results for tags 'name'.
Found 5 results
-
Ola pessoal, Alguém pode me orientar? Estou com um campo textarea que esta chamando o editor CKEDITOR, pelo name="txtArtigo" Meu problema é que para enviar os dados para o banco, também usa o name="desc_imc" Deve ser algo fácil, mas sou iniciante e me perco em algumas coisas. <div role="tabpanel" class="tab-pane active" id="descricao_imc"> <div style="padding-top:20px;"> <form method="post" action="cadastrar_descricao.php"> <textarea id="desc_imc" type="text" name="txtArtigo"></textarea><br> <input class="btn btn-outline-success" type="submit" value="Cadastrar" name="button" /> <script src="ckeditor/ckeditor.js"></script> <script>CKEDITOR.replace( 'txtArtigo' );</script> </div> </div>
-
Fala rapaziada, estou com uma duvida, como faço pra pegar um array de um formulário via javascript? Eu editei um exemplo aqui, porém ele não funciona não, vejam: <!DOCTYPE html> <html> <head> <script> function validateForm() { var x = document.forms["myForm"]["fname"][0].value; alert(x); } </script> </head> <body> <form name="myForm" action="/action_page.php" onsubmit="return validateForm()" method="post"> Name1: <input type="text" name="fname[]"> Name2: <input type="text" name="fname[]"> <input type="submit" value="Submit"> </form> </body> </html> Outro pergunta, é possível pegar um array dessa forma aí no exemplo sem utilizar o form? Desde já agradeço rapaziada. abração e fiquem com Deus.
-
Ajuda para gerar novas linhas de tabela com names de textarea diferent
JpBitencourt posted a topic in Javascript
Olá, estou tentando achar uma solução para o meu problema, não entendo nada de javascript, mas se alguém puder me ajudar eu agradeço. Tenho o seguinte script que adiciona novas linhas em minha tabela sempre que clico em um botão, ele funciona perfeitamente porém cada td tem um textarea e gostaria de gerar um name diferente em cada linha. Alguém tem alguma sugestão de como poderia fazer isso? Segue o script: <script> var cadastro2 = { linha2: '<td align="center"><textarea class="cols3" rows="2" cols="12" style="overflow: hidden" onkeyup="this.style.height=\'24px\'; this.style.height = this.scrollHeight + 1 + \'px\';" onkeydown="this.style.height=\'24px\'; this.style.height = this.scrollHeight - 1 - \'px\';" name="campo1"></textarea></td>'+ '<td align="center"><textarea class="cols3" rows="2" cols="12" style="overflow: hidden" onkeyup="this.style.height=\'24px\'; this.style.height = this.scrollHeight + 1 + \'px\';" onkeydown="this.style.height=\'24px\'; this.style.height = this.scrollHeight - 1 - \'px\';" name="campo2"></textarea></td>'+ '<td align="center"><textarea class="cols3" rows="2" cols="12" style="overflow: hidden" onkeyup="this.style.height=\'24px\'; this.style.height = this.scrollHeight + 1 + \'px\';" onkeydown="this.style.height=\'24px\'; this.style.height = this.scrollHeight - 1 - \'px\';" name="campo3"></textarea></td>'+ '<td align="center"><textarea class="cols3" rows="2" cols="12" style="overflow: hidden" onkeyup="this.style.height=\'24px\'; this.style.height = this.scrollHeight + 1 + \'px\';" onkeydown="this.style.height=\'24px\'; this.style.height = this.scrollHeight - 1 - \'px\';" name="campo4"></textarea></td>'+ '<td align="center" colspan="2"><textarea class="cols4" rows="2" cols="35" style="overflow: hidden" onkeyup="this.style.height=\'24px\'; this.style.height = this.scrollHeight + 1 + \'px\';" onkeydown="this.style.height=\'24px\'; this.style.height = this.scrollHeight - 1 - \'px\';" name="campo5"></textarea></td>'+ '<td align="center" class="semborda"><input type="button" value="-" class="ui-button ui-widget ui-state-default ui-corner-all principal" onclick="javascript:deleteRow2(this.parentNode.parentNode.rowIndex)" title="Remover linha"></input></td>', adicionarLinha2: function(){ //encontrar o elemento com id "tblCadastroTBody2" (tbody) var tbody = document.getElementById('tblCadastroTBody2'); //criar um novo elemento do tipo TR var tr = document.createElement('tr'); //colocar o conteúdo da linha no TR tr.innerHTML = cadastro2.linha2; //inserir a linha criada no tbody tbody.appendChild(tr); } } </script> Desde já agradeço.- 1 reply
-
- table
- javascript
-
(and 2 more)
Tagged with:
-
Olá pessoal do fórum. Preciso de ajuda em um bug que não estou entendendo. Fiz um site com todo o conteúdo em uma só página, cada página do menu, desce rolando até o certo ponto. Mas pela primeira vez, sempre vai pro lugar errado, na maioria das vezes a página rola pra baixo da parte que deveria. Queria a ajuda de vocês pra descobrir o que esta acontecendo. Código do javascript: $(window).load(function() { function filterPath(string) { return string .replace(/^\//,'') .replace(/(index|default).[a-zA-Z]{3,4}$/,'') .replace(/\/$/,''); } $('a[href*=#]').each(function() { if ( filterPath(location.pathname) == filterPath(this.pathname) && location.hostname == this.hostname && this.hash.replace(/#/,'') ) { var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) +']'); var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false; if ($target) { var targetOffset = $target.offset().top; $(this).click(function() { $('html, body').animate({scrollTop: targetOffset}, 1500); return false; }); } } }); }); Código html do menu: <nav id="menu"> <ul> <li> <img id="logo" src="logo-menu.png" alt="logo" width="100px"/> </li> <li> <a href="#topo">Home</a> </li> <li> <a href="#sobre">Sobre</a> </li> <li> <a href="#portfolio">Portfólio</a> </li> <li> <a href="#servicos">Serviços</a> </li> <li> <a href="#rodape">Contato</a> </li> </ul> </nav> A paginas estão linkadas pelo 'id'. São articles, sections, divs e footers.
-
- javascript
- ancora
- (and 4 more)
-
Quando executo o login aparece esta mensagem: Fatal error: Function name must be a string in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\data\localweb\phpteste1\login.php on line 22 Obs: linha 2:= $login = $_POST('login');. <?php class Sql{ public $host, $user, $pass, $query; public function __construct(){ mysql_connect($this -> host = 'localhost', $this -> user = 'root', $this -> pass = '1234' ); mysql_select_db('cadastro'); } public function query($qr){ $this -> query = mysql_query($qr); return $this; } public function retornar(){ return $this -> query; } } $sql = new sql; $login = $_POST('login'); $pwd = $_POST('senha'); $selecionar = $sql -> query("SELECT * FROM USUARIO WHERE LOGIN = '$logi' AND SENHA = '$pwd'"); $c = mysql_num_rows($selecionar); if($c){ echo "logado"; }else{ echo "deslogado"; } ?>