Hi all,
I am trying to use pickaday jquery library in MyBB 1.8 as 1.8 has jquery inbuilt.
I modified my custom thread field with below option :-
Input Field Type : Textbox
Text Mask filter : DD/MM/YYYY
Custom Html -
Display Format:
In my newthread template, I am having following code :-
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
<html>
<head>
<title>{$lang->newthread_in}</title>
{$headerinclude}
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/moment.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/pickaday.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/pickaday.jquery.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1813"></script>
</head>
<body>
{$header}
{$preview}
{$thread_errors}
{$attacherror}
{$moderation_notice}
<form action="newthread.php?fid={$fid}&processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder tmob_hide">
<tr>
<td class="thead"><strong>{$lang->post_new_thread}</strong></td>
<td class="thead"><strong class="mobile_show">{$lang->post_new_thread}</strong></td>
</tr>
<tr>
<td class="trow2" width="20%"><strong>{$lang->thread_subject}</strong></td>
<td class="trow2">{$prefixselect}<input type="text" class="textbox" name="subject" size="30" maxlength="85" value="{$subject}" tabindex="1" /></td>
</tr>
{$extra_threadfields}
{$modoptions}
{$captcha}
</table>
<br />
<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" /> </div>
<input type="hidden" name="action" value="do_newthread" />
<input type="hidden" name="posthash" value="{$posthash}" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
<input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
<input type="hidden" name="tid" value="{$tid}" />
</form>
{$forumrules}
{$footer}
<script type="text/javascript">
var picker = new Pikaday(
{
field: document.getElementById('datepicker'),
firstDay: 1,
minDate: new Date(2000, 0, 1),
maxDate: new Date(2020, 12, 31),
yearRange: [2000,2020],
onSelect: function() {
document.getElementById('datepicker').value = this.getMoment().format('DD/MM/YYYY');
}
});
picker.setMoment(moment().dayOfYear(366));
</script>
</body>
</html>
I am able to see the datepicker properly but once I submit the thread, I see NULL getting stored in database, which I feel should not show as nulled.
Anyone can tell what might be wrong ?