Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#5316 closed bug (notabug)

Datepicker altfield not populated after submit (onload)

Reported by: spilja Owned by:
Priority: major Milestone:
Component: ui.datepicker Version: 1.8rc3
Keywords: datepicker, form submit, altfield Cc:
Blocked by: Blocking:

Description

Let's have an input field for a date using Datepicker, and an altfield populated from the said input, in a JSP.

<script type="text/javascript">
    $(function(){
            $("#datepicker").datepicker altField: '#altDate', altFormat: 'yy-mm-dd'});
</script>


<input type="text" id="datepicker" name="datepicker" value="${datepicker}"/>
<input type="text" id="altDate" name="altDate"/>

After a form using these inputs is submitted, the "datepicker" field is filled with the previously entered date, but the "altDate" is not. That means that submitting the form again calls the form with the "altDate" being empty.

A solution would be for the altfield to be loaded in a window.onload function which checks the content of the "datepicker" field.

Change History (3)

comment:1 Changed 9 years ago by Scott González

Resolution: invalid
Status: newclosed

I don't really understand the problem. The example code will never have a valid value on load. Also, since submitting a form will result in a new page load, I don't know why you're trying to point to a bug based on a successful submit.

If you continue to have problems, please ask for hep on the forums.

comment:2 Changed 9 years ago by spilja

It's because the datepicker field gets populated after form submition (or on page load, as you wish), but the associated altfield does not.

I've asked a question about it in the forums.

comment:3 Changed 6 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.