Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set constant name for some inputs #74

Open
rhnkyr opened this issue Oct 28, 2017 · 0 comments
Open

Set constant name for some inputs #74

rhnkyr opened this issue Oct 28, 2017 · 0 comments

Comments

@rhnkyr
Copy link

rhnkyr commented Oct 28, 2017

Hi guys,

i want to upload multiple files via c# IEnumerable<HttpPostedFileBase> and try to fix input:file name to listImages. My code like this :

`var id = 0;
$(".mt-repeater").each(function(){
$(this).repeater({
show: function () {
$(this).slideDown();
$(this).find("textarea").attr("id", "mce"+id);
$(".mt-repeater").find('input:file').attr('name', "listImages");
tinymce.EditorManager.execCommand("mceAddEditor", true, "mce"+id);
id++;
},

                    hide: function (deleteElement) {
                           
                        alertify.confirm('XXXXXX',
                            'XXXXXXXX',
                            function() {
                                $(".mt-repeater").find('input:file').attr('name', "listImages");
                                $(this).slideUp(deleteElement);
                            },
                            null);
                       
                    },
                    ready : function() {
                        $(".mt-repeater").find('input:file').attr('name', "listImages");
                    },
                    isFirstItemUndeletable: true

                });
            });`

show works ok like this but when i delete a repeater row my first file input name changes to listElements[0][listImages]

How can prevent it or is there any proper solution for that.

Thanks in advance. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant