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

Help - How to customize hidden input? #39

Closed
emerics opened this issue Mar 28, 2012 · 1 comment
Closed

Help - How to customize hidden input? #39

emerics opened this issue Mar 28, 2012 · 1 comment

Comments

@emerics
Copy link

emerics commented Mar 28, 2012

Hello,

This is probably a stupid question but I try to add a name to the hidden input to get the data when I POST it.
I tried multiple things without any success.

For example:
$('#tagarea', currentTab)
.textext({
plugins : 'autocomplete filter tags ajax arrow prompt',
prompt : 'Add some tags...',
htmlHidden : '',
ajax : {
url : 'gettag/json',
dataType : 'json',
cacheResults : true
}
})
;

How does it work?

Thank you in advance

@emerics
Copy link
Author

emerics commented Mar 29, 2012

I found the solution to my problem. I had a look at the sources and I found the following lines:

    // set the name of the hidden input to the text input's name
    hiddenInput.attr('name', input.attr('name'));
    // remove name attribute from the text input
    input.attr('name', null);

The solution is to simple add the attribute name to the textarea...

<textarea id="tagarea" rows="1" style="width:300px;" name="hiddenInputName"></textarea>

Thanks for this great plugin.

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