stephanwagner / mform Goto Github PK
View Code? Open in Web Editor NEWmForm helps you to make your forms and form elements nicer, better and more awesome.
mForm helps you to make your forms and form elements nicer, better and more awesome.
Line 388.
this.optionsAmount.visible = ...
reading this.optionlist.length throws an error, because optionlist is not defined.
This condition triggers only for certain number of options in the list, so it is not that obvious to run into. In your demo, for "select country", have number of option be 11 or 12 and you will see the issue.
When I have a normal select field that needs to be shown in a modal window, it wont unfold.
<form>
<select data-select>
<option value="1">yes</option>
<option value="2">no</option>
</select>
</form>
I did found a solution, and that is to remove data-select out of the select element and create it with
new mForm.Element.Select();
Only problem then is that you have to add a delay.
(function() { new mForm.Element.Select(); }).delay(1000);
Here is the script: http://mijngamepc.nl/mboxmform/mBox.Advanced.js line 90
As you can see, if a select field has the title attribute it will do a JSON request and build the select field (options) from that data.
So if other people have the same problem, this is a solution.
My forms will hide automatically at dom ready and when a Modal windows is initialized the form will be shown correctly (when a form is styled with: display: none; the form won't show correctly, so this is my little fix).
$$('form.mForm,form.mFormAuto').each(function(formelements)
{
formelements.setStyle('display', 'none');
});
Now when a modal window with a form is being initialized there are some JSON requests that will get the data for making the select fields.
The form standard contains the next code:
select name="devicetype" placeholder="Type Apperaat" name="type" title="ajax/AjaxGetDeviceTypes.php" data-required style="width:275px"></select
the new options are injected and with the help of
new mForm.Element.Select({original: selectid, search: false, noSearchResults: 'Geen resultaten', placeholderSearch: 'Zoeken...'});
it will make a nice select with a nice placeholder. But when i want an option be selected as default it wont work and I'll get the next error:
this.select is undefined
this.select.removeClass(className);
so when I remove the attribuut 'placeholder' out of the select element it will create that error. I can't make a fix. So is this a bug? Or is there a temp fix? Version 0.2 also didn't solve it.
plese add these feature
thanks
Hi,
I have download the StephanWagner-mForm-0.2.6-0-gbd88dd1.zip file and just extract it and open the index.html inside Demo Folder.
It's working awesome in many browsers but drop-downs doesn't working in IE11, but it's working in http://htmltweaks.com/mForm.
Can you please have a look on it ..
As you may know my modal windows contains form elements. These form elements are cloned from a original one so I can have unlimited amount of modal windows.
The only problem is now that when input field is filled in the red dot wont disappear. Also on select fields, I have to select a item twice before the red dot goes away.
Here is an image: http://mijngamepc.nl/mboxmform/Naamloos.png
Changed some dutch words into English. But as you can see the red dot from an input field won't disappear at all. The first select fields doesn't has a placeholder so there will be a option selected as default and there isn't a red dot which is good. But the last select field isn't working good and an option has to be clicked on twice.
Version 2.5 did solve the following issue: #1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.