How to add a new Input Field Type?
hansolo Offline
Junior Member
**
Posts: 22
Joined: Sep 2015
Post: #12
RE: How to add a new Input Field Type?
OK I made the modifications. My code in my template looks like:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
{$headerinclude}
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1800"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/datepicker-en-GB.js"></script>
<script type="text/javascript">
  jQuery(function() {
  	jQuery("#datepicker").datepicker(
		{ dateFormat: "dd/mm/yyyy" }).val()
  	$.datepicker.setDefaults($.datepicker.regional["en-GB"]);
  });
</script>


Text mask filter: Date (dd/mm/yyyy)
Input formatter: <?=strtotime({VALUE})?>
Input field html: <input type="text" class="textbox"{NAME_PROP}{MAXLEN_PROP}{WIDTH_PROP_SIZE}{TABINDEX_PROP}{REQUIRED_PROP} value="{VALUE}" id="datepicker" />
Display parsing: plain text
Display format: <?=date('d-m-Y', {VALUE})?>

However I have two problems:
1) The jquery datepicker is being obscured by the message section. I guess this is something to do with some CSS code?
2) When I select a date, it enters it into the textbox like: "18/09/20152015" instead of like "18/09/2015" (which is what I want)

Any ideas whats wrong? Cheers!

09-18-2015 03:17 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: How to add a new Input Field Type? - hansolo - 09-18-2015 03:17 PM

 Standard Tools
Forum Jump: