Variavel em Script , alterar valor.
Boa tarde Pessoal ,
estou utilizando o JQuery-UI .
onde possuo uma pagina em php .
teste2.php
<h2>Select a Date in first TextBox. Then click the Button to see how 3 days is added to this Date and shown in "Follow Date" TextBox.</h2>
<p>Date:
<input id="txtDate" type="text" />
</p>
<p>
<input type="button" onclick="getdate()" value="Fill Follow Date" />
E o Script para executar o Datepicker .
$(document).ready(function () {
$('#txtDate').datepicker();
$('#follow_Date').datepicker();
});
function getdate() {
var tt = document.getElementById('txtDate').value;
var date = new Date(tt);
var newdate = new Date(date);
newdate.setDate(newdate.getDate() + 3);
var dd = newdate.getDate();
var mm = newdate.getMonth() + 1;
var y = newdate.getFullYear();
var someFormattedDate = mm + '/' + dd + '/' + y;
document.getElementById('follow_Date').value = someFormattedDate;
}
como faço para , transformar o valor "3" na linha :
ewdate.setDate(newdate.getDate() + 3);
Em algo , que eu possa alterar atraves de um formulario.
no php usase o $variavel , mas como funciona em Script ?
Obrigado.
Discussão (1)
Carregando comentários...