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

generateFormElements() doesn't work with string args #403

Closed
mar10 opened this issue Feb 26, 2015 · 2 comments
Closed

generateFormElements() doesn't work with string args #403

mar10 opened this issue Feb 26, 2015 · 2 comments

Comments

@mar10
Copy link
Owner

mar10 commented Feb 26, 2015

See http://stackoverflow.com/q/28719020/19166

@mar10 mar10 closed this as completed in a1ce104 Mar 1, 2015
@pmishev
Copy link

pmishev commented Oct 24, 2016

Shouldn't this line
selectedName = (typeof selected === "string") ? selected : "ft_" + this._id + "[]",
rather be:
selectedName = ( (typeof selected === "string") ? selected : "ft_" ) + this._id + "[]",

How else are you supposed to override the input name, keeping the id in it?

@mar10
Copy link
Owner Author

mar10 commented Nov 5, 2016

@pmishev , this call

tree.generateFormElements("cust_sel", "cust_act");

will generate markup like this:

<div id="fancytree_result_1" style="display: none;">
    <input type="checkbox" name="cust_sel" value="10" checked="checked">
    <input type="checkbox" name="cust_sel" value="10_1" checked="checked">
    <input type="checkbox" name="cust_sel" value="10_1_1" checked="checked">
    <input type="checkbox" name="cust_sel" value="10_1_2" checked="checked">
    <input type="radio" name="cust_act" value="10_1" checked="checked">
</div>

I don't think there is a need to have separate names for it, since the checkboxes are identified by the value attributes.

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

2 participants