Extension talk:Semantic Forms Inputs
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| Multiple values for a menuselect field | 5 | 12:31, 27 January 2012 |
| No year scrolling | 4 | 10:54, 20 December 2011 |
| Regular Expression for validating that Form Inputs don't contain special characters | 0 | 09:35, 14 December 2011 |
| SemanticFormsInputs.i18n.php | 1 | 16:01, 3 December 2011 |
| Any reason to not support second resolution in hh:mm:ss? | 1 | 18:48, 31 October 2011 |
| Screeenshots | 1 | 14:28, 19 October 2011 |
| Dynamic default value (now) possible? | 8 | 21:12, 10 October 2011 |
| Buttons don't do anything | 3 | 13:31, 26 September 2011 |
| datepicker error | 2 | 18:00, 21 August 2011 |
| Timepicker JavaScript error when editing already-existing field | 2 | 03:26, 8 August 2011 |
| Timepicker/Datetimepicker - minute selection | 6 | 19:34, 10 May 2011 |
| semanticformsinputs-desc not shown on Special:Version | 4 | 22:16, 5 April 2011 |
| Datetimepicker default value | 4 | 02:40, 3 March 2011 |
Hi all,
I'm trying to use multiple values for a menuselect field. I tried to use a arraymap as Semantic Forms but it doesn't work. I don't know if it's possible but if it's case a help will be welcome. Thanks in advance
I share my little progress despite I don't have what I would want. May be I can have a feedback that can help me!
I use a template and with the call
{{{for template|MyTemplate|multiple}}}
I can have the number of fields I want. But the problem is since I specify values with a menuselect and when I edit the page for the first time values do not appear and if I enter values by my hand it doesn't considere it!
I'm working on, if I have a solution I will share wiht you but if somebody has an idea it is welcome
Cheers.
the previous post is mine! I forgot to identify myself
Hi. I am not sure I understand the problem. Could you explain a bit more? Maybe using a concrete example?
Here is an example
{{{for template|InfrastructureType|multiple}}}
{{{field|Infrastructure type|input type=menuselect |size=75
|structure=
*Cultural Building
*School
*Hospital
}}}
{{{end template}}}
the problem is when I create a page with this template the scrolling list doesn't display
Hi, I've just installed Inputs and I'm having a problem with the datepicker. The year selection seems to be fixed in a 10 year period either side of the default (or last selected) year. Scrolling thru to years not appearing in the list is not possible. MW 1.18, SF 2.3.1, SFI 0.5, SMW 1.6.1.
Fault is not dependednt on the "first date =" variable
I've tried IE on XP an Firefox on Mac OSX, same result.
Is it a bug or a problem with my settings somewhere?
Cheers - Scott
You are right. What would be the expected behaviour, though?
Sorry for the delayed reply, been rather busy of late...
I would expect it to keep scrolling back/forward through the years until you stopped pressing the up or down arrow. One of the forms I am using it in is to input a vehicle's year of manufacture. When someone begins to fill out the form and selects the year then they can only scroll back as far as 2001. This may confuse some into thinking that they cannot enter a date prior to that.
I would like it to work a bit differently than you proposed (e.g. like this, preferably with a click-and-hold feature for fast forward/backward), but I agree, that something like that would be a really nice feature. The problem is, it would require a change to the jQuery datepicker code, which is out of the scope of this extension. I will note it as a feature request, but better don't hold your breath on it.
If you are really intent on having this, you would have to drive it. I.e get someone at jqueryui.com to implement your feature and then kick me again to use it.
(What I probably could do is give you some option where you could set the years shown in the dropdown.)
Either way would work. I'd be surprised if it's hard to fix the existing control though. When you click on the year control, if you select the earliest year in the list the control disappears and shows the year selected. The next time you click on the control the year previously selected is centred in the list and you can go back another ten years. The control can eventually be 'hacked' to get back to the year that you want, you just can't get there via the scroll buttons.
Regular Expression for validating that Form Inputs don't contain special characters
Hi,
I spent weeks trying to find how to do this - so I thought it would be a good idea to tell other people.
Here's a form input with regular expression, that validates that there are no
{{, }} or |
characters in the field:
(Ref https://bugzilla.wikimedia.org/show_bug.cgi?id=30042 and http://wikimedia.7.n6.nabble.com/Semantic-Forms-Need-better-input-checking-td555083.html)
{{{field|Description
| input type=regexp
|base type=regexp
|or char=;
|regexp=/(?:^\{\{VALIDATIONOFF\}\};^(?:(?!\{\{;\}\}).)*$)/
|message=Dont use }} or {{ without making sure that you always have a matched pair of brackets. To bypass this warning please put { {VALIDATIONOFF} }; at the very beginning of your input (without the spaces).
|base prefix=filter2
|filter2.regexp=/\!/
|filter2.inverse
|filter2.message=Don't use a pipe {{!}} in the input. Use { {!} } instead (without the spaces and not inside <pre>)
|filter2.base type=textarea
|rows=10|cols=100|autogrow
}}}
Hi, the /qqq section is somehow diveded into two parts and thus contains double entries. Cheers
It would be handy if the date and time pickers could support second resolution. Is there any reason to not support second resolution in hh:mm:ss?
The docs are quite nice, except that you cannot get an idea of what a certain input looks like at a glance. Having some screenshot for each input would greatly help that. And maybe with each screenshot a link to some example.
With SF's input type=date or datetime it's possible to specify 'default=now', and it'll fill in the current time, is this also possible with date(time)picker? 'default=2011/10/10' in the form definition does not work, since the #time parser functions does not get evaluated.
I'm afraid it is not possible with either of them. The default value is handed down to the input type in the same parameter as the current value, there is no possibility to distinguish between them so I can't decide when to parse and when not. The solution lies with SF here. You might vote on this or this bug or (more effectively) discuss it with Yaron directly.
It's not clear to me that this requires any change from SF - it might just need a fix in SFI. F.trott and I talked about the issue "offline", but now I don't remember what the conclusion was.
I do. :)
The point is, SFI could parse the current/default value given as a parameter to the input. But then it would also parse any user input a user might have done earlier. E.g. lets say it would indeed parse the value. Along comes some user thinking that "{{#time:...}}" would be a good thing to put into that field - would result in a valid date after all. This user would fully and rightly expect that "{{#time:...}}" appears verbatim in the page. It even would after the first edit. Then on the second edit the datepicker would parse that string and save it, i.e. it would replace the parser command by a static value.
Patrick, could you try updating to the last SVN version of SF and using default={{#time:Y/m/d}}? (You will need Extension:ParserFunctions if you don't have it yet.) The "default" parameter should get parsed now. It's still brand new, so any bug reports would be welcome.
just tried that, but the date doesn't get parsed inside the form field. I'm using SF 2.2.1, SFI 0.4.2 alpha, parser functions 1.4.0
Hmm, should work.
What exactly do you specify as the default and what is displayed in the form?
And does it work if you use a different input type, e.g. text?
Using default with the parser worked for me. Remember that if you use a parser within a field declaration make sure it is not the last parameter specified, or if it is, place the 3 field closing curly braces on the next new line, otherwise it will break the field; for example:
- WRONG:
{{{field|bulletin_date|mandatory|input type=datetimepicker|default={{#time:Y/m/d}}}}} - RIGHT:
{{{field|bulletin_date|mandatory|default={{#time:Y/m/d}}|input type=datetimepicker}}} - RIGHT:
{{{field|bulletin_date|mandatory|input type=datetimepicker|default={{#time:Y/m/d}}
}}}
Cheers.
Hi,
For me, the buttons appear, but don't do anything when clicked in either Firefox or IE.
I'm running:
- MW 1.16.2
- Semantic Forms (Version 2.1.1)
- Semantic Forms Inputs (Version 0.4.1)
- Semantic Maps (Version 0.7.6.1)
- Semantic MediaWiki (Version 1.5.6)
- Semantic Result Formats (Version 1.5.3)
Any ideas? Thanks, Jon
PS, seemed to start working if I only have one picker on a page. I had two.
You could try to update Semantic Forms, version 2.1.1 was pretty buggy. If that does not help, please try to reproduce the bug on http://scratchpad.referata.com/wiki/Form:Project_Facts. Or open the Firefox error console (ctrl-shift-J) and see if any JavaScript errors pop up.
I have the same problem: clicking the Buttons does not trigger any reaction. I am running:
- MW 1.16.1
- Semantic MediaWiki (Version 1.6)
- Semantic Forms (Version 2.2.1)
- Semantic Forms Inputs (Version 0.4.1)
I did the ctrl-shift-J and saw several errors, but nothing that has to do with Semantic Forms Inputs. At least I did not see it. But Internet Explorer told me the problem:
Message: The object does not support this value oder method Line: 154 Character: 2 Code: 0 URI: http://xxxx/mediawiki/extensions/SemanticFormsInputs/libs/datepicker.js
Line 154 in my datepicker.js is as follows:
var disabledDates = jQuery( input ).datepicker( "option", "disabledDates" );
What could be wrong there? Any help is greatly appreciated
I want to have a datepicker field. I've installed this extension latest version (0.4.1) I've added it to an existing working form on MW 1.16.5+SMW 1.5.6 + SF 2.2. But it's not working, I'm getting an empty field instead of a nice datepicker box. I'm noticing a javascript error Error: missing ] after element list Line: 92, Column: 25 Source Code:
monthNamesShort: ['ינו,'פבר,'מרץ','אפר,'מאי','יוני','יולי','אוג,'ספט,'אוק,'נוב,'דצמ],
(month names are in hebrew)
Obviously ] is not missing. Is this a known error? Thank you85.250.162.123 16:21, 19 August 2011 (UTC)
Hi,
no, this is not a known error, so thanks for the report!
The problem seems to be with the hebrew localization. For some reason the month names contain apostrophes and apparently I did not escape them before including them in the JavaScript code. This leads to garbage strings which the browser can not interpret.
I will fix this bug in the next version, though I am pretty busy right now, so it could take a bit. If you want you can monitor the bug report I created for that: https://bugzilla.wikimedia.org/show_bug.cgi?id=30478 . Just add your email address to the CC list.
Thanks. Either way, I manually changed the abbreviated month names in MessagesHe.php, which made this error message disappear, but the datepicker is still not working, and all I get is still an empty box instead of a nice date picker. So this is not the only problem. Since there are no more errors, just a lot of warnings it's hard to tell what is the problem now 85.250.162.123 18:00, 21 August 2011 (UTC)
Hello, all. I have a form with a repeating multiple instance template with 2 timepicker fields inside. The fields save correctly the first time I click "Add Another" and generate the new fields. I can use the JavaScript timepicker just fine, and the data saves correctly to the page.
However, when I try to edit that same page, there is a JavaScript error when I click on any of the existing timepicker icons. (Any new fields created by clicking "Add Another" work just fine though.) The JavaScript error on each click reads:
document.getElementById(this.id.replace("_button", "_tp_show")) is null
Thanks so much for your help! This is a great extension! --Blicarea 04:42, 31 July 2011 (UTC)
Is the datetime picker designed to only shows the hour, not hour and minute? --Dgennaro 19:49, 9 May 2011 (UTC)
No, it definitely should show minutes (15min steps by default).
I have created a test form on Scratchpad Referata. --Dgennaro 20:28, 9 May 2011 (UTC)
Works for me on IE8 and FF4.0.1 (both WinXP), shows 00:00 to 23:30 in 30 min steps. Can't check other browsers right now.
Ah, yes. We are running IE 7 and FF3.6.6 and are unable to update. Thanks for checking. --Dgennaro 21:00, 9 May 2011 (UTC)
Hi, I just want to let you know, that the description of the extension is not being displayed on Special:Version. (SFI 0.4.1 and MW 1.16.2) Cheers
Hi kgh, can't reproduce it. See here for example: http://scratchpad.referata.com/wiki/Special:Version.
Hmm, did you try using another language than English? This problem occurs on all three of my installations. Thus I think it is not happening hazardously. Cheers
Yes, no problem at all: http://scratchpad.referata.com/wiki/Special:Version?uselang=de
I also set the wiki language in LocalSettings.php. Again no problems.
We had this before. What was the solution back then? https://bugzilla.wikimedia.org/show_bug.cgi?id=25017
Oops, I totally forgot about this. :( Now I remember: I directly replaced semanticformsinputs-desc by description and inserted the desciption in SemanticFormsInputs.php. The only strange thing is that it is the only extension behaving like that. Since nobody else seems to run into this I suspect me as the big bug. :) Thank you again for taking you time and looking into it. I will do some further investigation. Cheers
When I have an input of the native SF type datetime, it accepts this default value "1/1/2011 7:30:00 PM", when I use datetimepicker, it does not, as it's requiring the notation to be in yyyy/mm/dd hh:mm. It's probably best if SFI used the same parsing code as SF here, to avoid such inconsistencies.
Huh, even when using yyyy/mm/dd hh:mm, it's just showing the value for yyyy as default. This is happening for MW+SMW+SF+SFI trunk.