How to add a new Input Field Type?
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #5
RE: How to add a new Input Field Type?
Thank you Lee, without that script still works. Anyway I have to edit the post, because that code works with string date and if hansolo wants only a datepicker on date all that edits doesn't need.

If you want only a datepicker on date:

"Date" in Text Mask Filter
Input Formatter: {VALUE}

Use Custom Input HTML yes and then

Code:
<input type="text" class="textbox"{NAME_PROP}{MAXLEN_PROP}{WIDTH_PROP_SIZE}{TABINDEX_PROP}{REQUIRED_PROP} value="{VALUE}" id="datepicker" />


Display Format: {VALUE}

Then in newthread and edit post add/edit:

- After headerinclude:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1800"></script>
  
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">

  <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
  <script src="your-link-to script-datepicker-XX.js"></script>
  
  <script type="text/javascript">
jQuery(function() {
jQuery("#datepicker").datepicker({ dateFormat: "dd/mm/yy" }).val()
$.datepicker.setDefaults($.datepicker.regional['XX-your-language']);
});
</script>


This should works without too changes.

(This post was last modified: 09-17-2015 12:36 AM by nier3.)
09-17-2015 12:35 AM
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? - nier3 - 09-17-2015 12:35 AM

 Standard Tools
Forum Jump: