Skip to main content

Search and Top Navigation

#5316 closed bug (notabug)

Opened March 09, 2010 10:39PM UTC

Closed March 10, 2010 01:59AM UTC

Last modified October 11, 2012 09:15PM UTC

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.

Attachments (0)
Change History (3)

Changed March 10, 2010 01:59AM UTC by scottgonzalez comment:1

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.

Changed March 10, 2010 08:16AM UTC by spilja comment:2

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.

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:3

milestone: TBD

Milestone TBD deleted