0
Is being sent from the server to this view an object with some information and among them are the values I want to assign to each input
s select
, but I cannot assign. I am using ejs
as my view engine
.
<!DOCTYPE html>
<html lang="pt-Br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
})
</script>
</head>
<body>
<form action="/" method="POST">
<label for="number">Número:</label> <input disabled type="text" name="number" value="<%=infoTabs[0].number%>" id="number"><br><br>
<label for="action">Ação:</label><select disabled name="action" value="<%=infoTabs[0].action%>" id="action">
<option value="Migração pré-controle">Migração pré-controle</option>
<option value="Migração controle-pós">Migração controle-pós</option>
<option value="Troca de plano">Troca de plano</option>
<option value="Migração pré-pós">Migração pré-pós</option>// validar o value do select
</select><br><br>
<label for="actuallyPlan">Plano atual:</label><select disabled name="actuallyPlan" value="<%=infoTabs[0].action%>" id="action">
<option value="ctrl1">ctrl1</option>
<option value="ctrl2">ctrl2</option>
<option value="ctrl3">ctrl3</option>
<option value="ctrl4">ctrl4</option>// validar o value do select
</select><br><br>
<label for="newPlan">Plano atual:</label><select disabled name="newPlan" value="<%=infoTabs[0].action%>" id="action">
<option value="ctrl1">ctrl1</option>
<option value="ctrl2">ctrl2</option>
<option value="ctrl3">ctrl3</option>
<option value="ctrl4">ctrl4</option>
</select><br><br>
<label for="obs">Observações:</label><input type="text" disabled name="obs" id="obs"><br><br>
<label for="os">Número da OS:</label><input type="text"disabled name="os" id="os" value="<%=infoTabs[0].os%>"><br><br>
<input type="button" disabled value="Salvar venda">
</form>
<div id="saco"></div>
</body>
</html>
See if that question helps you. Although it is in PHP, it will give you an idea of how to proceed.
– Luiz Felipe