Extension talk:Semantic Forms Inputs

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Contents

Thread titleRepliesLast modified
Multiple values for a menuselect field512:31, 27 January 2012
No year scrolling410:54, 20 December 2011
Regular Expression for validating that Form Inputs don't contain special characters009:35, 14 December 2011
SemanticFormsInputs.i18n.php116:01, 3 December 2011
Any reason to not support second resolution in hh:mm:ss?118:48, 31 October 2011
Screeenshots114:28, 19 October 2011
Dynamic default value (now) possible?821:12, 10 October 2011
Buttons don't do anything313:31, 26 September 2011
datepicker error218:00, 21 August 2011
Timepicker JavaScript error when editing already-existing field203:26, 8 August 2011
Timepicker/Datetimepicker - minute selection619:34, 10 May 2011
semanticformsinputs-desc not shown on Special:Version422:16, 5 April 2011
Datetimepicker default value402:40, 3 March 2011

Multiple values for a menuselect field

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

Fary10:34, 23 January 2012
Edited by another user.
Last edit: 08:26, 24 January 2012

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.

85.152.18.12916:58, 23 January 2012

the previous post is mine! I forgot to identify myself

Fary17:05, 23 January 2012

Hi. I am not sure I understand the problem. Could you explain a bit more? Maybe using a concrete example?

F.trott10:17, 27 January 2012

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

Fary12:20, 27 January 2012

That's a bug, it definitely should display. I will investigate it.

F.trott12:31, 27 January 2012
 
 
 
 
 

No year scrolling

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

Scott D00:45, 11 December 2011

You are right. What would be the expected behaviour, though?

F.trott10:07, 11 December 2011

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.

Scott D13:15, 19 December 2011

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.)

F.trott13:53, 19 December 2011

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.

Scott D10:54, 20 December 2011
 
 
 
 

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
}}}
195.212.29.9409:34, 14 December 2011

SemanticFormsInputs.i18n.php

Hi, the /qqq section is somehow diveded into two parts and thus contains double entries. Cheers

[[kgh]]14:45, 3 December 2011

Thanks, I fixed it.

Cheers,

F.trott16:01, 3 December 2011
 

Any reason to not support second resolution in hh:mm:ss?

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?

Badon18:40, 31 October 2011

It looks like even with the Unix time format, second resolution is removed.

Badon18:48, 31 October 2011
 

Screeenshots

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.

Jeroen De Dauw13:29, 19 October 2011

Screenshots are easy, will do that.

Example is a bit more difficult, you'd need something stable. I'll think about how this could be done.

F.trott14:28, 19 October 2011
 

Dynamic default value (now) possible?

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.

Patrick Nagel13:48, 9 March 2011

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.

F.trott20:35, 9 March 2011

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.

Yaron Koren16:00, 11 March 2011

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.

F.trott22:49, 11 March 2011
 
 

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.

F.trott22:57, 15 March 2011

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

213.33.22.12221:50, 8 August 2011

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?

F.trott07:34, 9 August 2011

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.

   Thorncrag  19:12, 10 October 2011

That bug is mentioned in the documentation - if it's any simpler, you don't even need a newline, you just need a space (like "}} }}}").

Yaron Koren21:12, 10 October 2011
 
 
 
 
 

Buttons don't do anything

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

122.57.135.6721:15, 3 April 2011

PS, seemed to start working if I only have one picker on a page. I had two.

JonPovey21:21, 3 April 2011

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.

F.trott21:35, 3 April 2011
 

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

Eilan Ardanos13:31, 26 September 2011
 

datepicker error

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)

85.250.162.12316:21, 19 August 2011

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.

F.trott19:38, 20 August 2011

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)

85.250.162.12318:00, 21 August 2011
 
 

Timepicker JavaScript error when editing already-existing field

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)

Blicarea04:42, 31 July 2011

Yes, this is a problem with the new Resource loader in MW 1.17. I am working on it.

F.trott10:27, 31 July 2011

Thanks for your reply. I also get the same error when trying to load a form containing a timepicker through a template.

Blicarea03:26, 8 August 2011
 
 

Timepicker/Datetimepicker - minute selection

Is the datetime picker designed to only shows the hour, not hour and minute? --Dgennaro 19:49, 9 May 2011 (UTC)

Dgennaro19:49, 9 May 2011

No, it definitely should show minutes (15min steps by default).

F.trott20:16, 9 May 2011

I have created a test form on Scratchpad Referata. --Dgennaro 20:28, 9 May 2011 (UTC)

Dgennaro20:28, 9 May 2011

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.

F.trott20:35, 9 May 2011

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)

Dgennaro21:00, 9 May 2011

Ok, just had a look at it in IE7 mode. Sure looks ugly (but shows the minutes, maybe they didn't bork down the ie8 enough to simulate ie7 correctly). Anyway, I'll look into it, but it may take some time.

F.trott21:43, 9 May 2011
 
 
 
 
 

semanticformsinputs-desc not shown on Special:Version

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

[[kgh]]19:48, 5 April 2011

Hi kgh, can't reproduce it. See here for example: http://scratchpad.referata.com/wiki/Special:Version.

F.trott21:19, 5 April 2011

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

[[kgh]]21:36, 5 April 2011

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

F.trott22:01, 5 April 2011

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

[[kgh]]22:16, 5 April 2011
 
 
 
 

Datetimepicker default value

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.

Jeroen De Dauw16:17, 28 February 2011

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.

Jeroen De Dauw16:21, 28 February 2011

True, and don't ask me how it got in. Will fix it tonight. Really stupid error, too - tried to use + to concatenate strings in PHP.

F.trott15:42, 1 March 2011

Fixed it in r83050.

F.trott22:10, 1 March 2011

Awesome, thanks. Will update the wiki where I'm using this soonish and let you know if I encounter any further problems :)

Jeroen De Dauw02:40, 3 March 2011
 
 
 
 
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox