Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Webmater Felipe Edwards

Cadastro automatico em outro input

Recommended Posts

Olá Galera do Imasters,

 

Tenho uma dúvida que é a seguinte:

Possuo um formulário de cadastro que o objetivo é agendar aulas de digitação em uma instituição. Nele possuo 4 campos (aula,aula2,aula3,aula4) quero que, quando eu clicar no "aula1" e agendar a primeira data, ele automaticamente a cada 4 dias ele agende automaticamente nos outros campos.

Exemplo:

se no campo 1 eu clicar e colocar a data 10/07/2013

 

ele preencha o campo 2 com 14/07/2013

o campo 3 com 18/07/2013

e o campo 4 com 22/07/2013

------------------------------------------------

O codigo fonte é o seguinte:

------------------------------------------------

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--Data Jquery-->
<link rel="stylesheet" href="../../js/jquery/css/smoothness/jquery-ui.css" />
  <script src="../../js/jquery/jquery-1.9.1.js"></script>
    <script src="../../js/jquery/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css" />
  <link rel="stylesheet"  href=""/>






<script>
//Campo 1
jQuery(function($){
        $.datepicker.regional['pt-BR'] = {
                closeText: 'Fechar',
                prevText: '<Anterior',
                nextText: 'Próximo>',
                currentText: 'Hoje',
                monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
                'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
                monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
                'Jul','Ago','Set','Out','Nov','Dez'],
                dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
                dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
                dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
                weekHeader: 'Sm',
                dateFormat: 'dd/mm/yy',
                firstDay: 0,
                isRTL: false,
                showMonthAfterYear: false,
                yearSuffix: ''};
        $.datepicker.setDefaults($.datepicker.regional['pt-BR']);
});


$(function() {
    $( "#datepicker" ).datepicker();
  });
  
  
    $(function() {
    $( "#datepicker2" ).datepicker();
  });
	
	
	    $(function() {
    $( "#datepicker3" ).datepicker();
  });
		
		
		
		    $(function() {
    $( "#datepicker4" ).datepicker();
  });
  </script>
  












<!-- Script que mostra o calendario do formulário -->

<link rel=”stylesheet” type=”text/css” href=../historico/”calendario.css” />
<script src="../historico/calendario.js" ></script>

<!-- Fim do script que mostra o calendario -->




<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema - Agendamento Digitação</title><style type="text/css">
<!--
body {
	background-image: url(../../images/bg_black.jpg);
}
-->
</style></head>

<body>
<form id="form1" name="form1" method="post" action="<?php echo $editFormAction; ?>">
  <table width="424" border="0" style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#FFF; font-weight:bold">
    <tr>
      <td align="center">Agendamento Digitação</td>
    </tr>
  </table>
  <table width="424" border="0" style="font-family:Verdana, Geneva, sans-serif; font-size:11px; color:#FFF; font-weight:bold">
    <tr>
      <td width="100">Aluno:</td>
      <td width="314"><input name="aluno" type="text" id="aluno" size="30" /></td>
    </tr>
    <tr>
      <td>Cart.:</td>
      <td><input name="cart" type="text" id="cart" size="15" /></td>
    </tr>
    <tr>
      <td>1º Aula:</td>
      <td><input name="aula1" type="text" id="datepicker" size="10" /></td>
    </tr>
    <tr>
      <td>2º Aula:</td>
      <td><input name="aula2" type="text" id="datepicker2" size="10" /></td>
    </tr>
    <tr>
      <td>3º Aula:</td>
      <td><input name="aula3" type="text" id="datepicker3" size="10" /></td>
    </tr>
    <tr>
      <td>4º Aula:</td>
      <td><input name="aula4" type="text" id="datepicker4" size="10" /></td>
    </tr>
  </table>
  <p> </p>
  <table width="424" border="0" style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#FFF; font-weight:bold">
    <tr>
      <td align="center"><input type="submit" name="button" id="button" value="Agendar Aulas de Digitação" /></td>
    </tr>
  </table>
  <p> </p>
  <input type="hidden" name="MM_insert" value="form1" />
</form>
</body>
</html>

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

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