[RESOLVIDO] datepicker do jquery

Olá, estou com problemas para fazer aparecer o datepicker do jquery na minha aplicação. Abaixo o código:

<head>
	<link href="css/smoothness/ui.datepicker.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="script/jquery-1.4.2.min.js"></script>
	<script src="script/ui.datepicker.js" type="text/javascript"></script>
</head>
<body>
	<div id="form-cadastro">
	<s:form id="formulario" action="save_acidente" name="formCadastro" theme="simple">
		<table>
			<tr>
			   <td style="text-align:right">
					   <label for="dataAcidente">Data:</label>
			   </td>
			   <td style="text-align:left">
				   <p>
					   <s:textfield name="acidente.dataAcidente" theme="simple" maxLength="10" cssStyle="width:70px;"/>
				   </p>
				</td>
			</tr>
		</table>
	</s:form>
	</div>
	<script type="text/javascript">
		$(document.formCadastro).ready(function() {
			$(document.formCadastro.getElementsByName('acidente.dataAcidente')).datepicker({
				dateFormat: 'dd/mm/yy',
				buttonText: '..',
				showOn: 'button',
				mandatory: true,
				changeYear: false,
				changeMonth: false,
				highlightWeek: true
			});
		});
	</script>
</body>

quando acesso a pág. consigo digitar a data no formato dd/mm/yy que ele salva direitinho (se fosse num textfield normal salvaria errado)…
O problema é que nao esta mostrando o botao para mim acessar o datepicker.
Alguém sabe ajudar? :S

Faaaala ailujana

Creio que neste link vc vai encontrar a resposta, não é nada complicado passei o link pq a documentação é vasta e pode te ajudar com mais coisas.

http://jqueryui.com/demos/datepicker/#icon-trigger

Vlwz

Boa tarde ailujana,
você deve fazer o seguinte:

// após carregar a página
$(document).ready(function() {  
    // pega o input que tem o nome acidente.dataAcidente
    $('input[name=acidente.dataAcidente').datepicker({  
        dateFormat: 'dd/mm/yy',  
        buttonText: '..',  
        showOn: 'button',  
        mandatory: true,  
        changeYear: false,  
        changeMonth: false,  
        highlightWeek: true  
    });  
});  

Isso deve te ajudar. Qualquer dúvida, posta aí.

consegui resolver :smiley:

meu script ficou assim:

<script type="text/javascript">
            $(document.formCadastro).ready(function() {
                $( "#datepicker" ).datepicker({
                    showOn: "button",
                    buttonImage: "imagens/calendar.png",
                    buttonImageOnly: true,
                    dateFormat: 'dd/mm/yy',				
                    mandatory: false,
                    changeYear: true,
                    changeMonth: true,
                    highlightWeek: true
                });


            });

        </script>

e no textfield adicionei o id=“datepicker”

<s:textfield id="datepicker" name="acidente.dataAcidente" theme="simple" maxLength="10" cssStyle="width:70px;"/>