Quantcast
Channel: Últimos conteúdos
Viewing all articles
Browse latest Browse all 14190

Recuperar valores

$
0
0
Eu tenho uma tabela, e nela preciso recuperar os valores que forem editados na mesma, o código que eu consegui até agora está a seguir:
 
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><!-- PARA CORRETA ACENTUAÇÃO -->
<title>Sistemas Lineares </title>
<script>
function criartabela(){
n = document.getElementById("ordem").value;
conteudo='<input type="number" id="ordem[i]" value=" ">';
var html="";
     html +='<table border>';
     for(var x=1;x<=n;x++){
          html+='<tr>';
          for(var y=1;y<=n;y++){
               html += '<td>'+conteudo+'</td>';
                             }
          html+='</tr>';
     }
     html+='</table>';
        document.getElementById('diiiv').innerHTML=html;
}
</script>
<script>
function matriz(){
criartabela();
a=n*n;
termo=[];
m= '';
for (i=0; i<a;i++){
termo[i]= '\r\nA'+i+'\r\n=' + '<br>' ;
m=m+termo[i];
}
document.getElementById('matriz').innerHTML=m;
}
</script>
<body>
<blockquote><blockquote> <!-- 2 tabs -->
<form>
<br><br>
Ordem da Matriz Quadrada:    <input type="number" id="ordem" value=" "><br><br>
</form>
<button onclick="criartabela()">Gerar Matriz a ser Preechida</button>
<br><br>
<style>ins{text-decoration:none;}</style>
<ins id="diiiv"></ins>
<br><br>
<button onclick="matriz()">valores dos termos</button>
<br><br>
<style>ins{text-decoration:none;}</style>
<ins id="matriz"></ins>
<br><br>
<button onclick="fpdf()">GERAR RELATÓRIO</button>
</blockquote></blockquote>
</body>
</html> 
 
No entanto na linha " termo[i]= '\r\nA'+i+'\r\n=' + '<br>' ; " não era bem isso que eu queria, queria de alguma forma mostar os valores que serão digitados na tabela, logo após o igual.
Não sei se estou no caminho certo, se alguém souber me ajudar, ou me mostrar algo mais fácil eu agradeceria.

Viewing all articles
Browse latest Browse all 14190

Trending Articles