Had a look at this today and I was wondering if you had any examples of how to use a database with it? In particular, if I want to use it to add tags to images, when I type the new tag and press enter, it appears in the view – how do I actually make it write to the DB though?
When you post the form it is in it will be sent as a comma separated string to the server, then depending on what you use serverside to connect to the database you would use something like Request.Forms(“Tags”) (ASP) or $_GET['Tags'] (PHP) and then use the value returned in your database query.
I am sorry but I might be missing something… Do you have an example of what you describe?
I am quite happy with posting form data and writing to the DB but the example you have doesn’t actually seem to use a form? Also, the tags are elements…
If I enclose it within a form, type the tag and press space (it adds the new tag to the div as an ) I don’t see any attempt to access my web server at the URL I specified in the form though.
Yes they are elements when shown on the page. Though if you it put in a form-tag and then submit the form the script will create a comma-delimited string that is posted with the form.
Hi,
I have a problem you jQuery plugin. I have been using the same page CKEditor and, xajax submit.
I remove the problem goes CKEditor. but I have to use the same page. Thank you for your help.
Hi Karl,
I’ve found useful a simple change to make the plugin work also within ajax forms. In this case you’ll probably find form tags with filled “onsubmit” attribute, this will prevent the form.submit() event triggering.
This was the code before:
var form = $(this).parents(“form”);
form.submit(function() {
parse();
hiddenText.val(itemBase.join(options.separator));
hiddenText.attr(“id”, textBase.attr(“id”));
hiddenText.attr(“name”, textBase.attr(“name”));
textBase.attr(“id”, textBase.attr(“id”) + ‘_old’);
textBase.attr(“name”, textBase.attr(“name”) + ‘_old’);
});
and now:
var form = $(this).parents(“form”);
if (“” == form.attr(“onsubmit”)) {
form.submit(onSubmit);
}
else {
form.children(“[type=submit]“).click(onSubmit);
}
In the case where you have a lot of tags, say 20 tags, they seem to extend across the screen horizontally, as they are displayed “inline”. Is there a simple way to get them to drop down vertically? Perhaps even a blank LI with display set to “block” that is injected every X items?
Hi,
Had a look at this today and I was wondering if you had any examples of how to use a database with it? In particular, if I want to use it to add tags to images, when I type the new tag and press enter, it appears in the view – how do I actually make it write to the DB though?
Regards,
Graham
Hi Graham,
When you post the form it is in it will be sent as a comma separated string to the server, then depending on what you use serverside to connect to the database you would use something like Request.Forms(“Tags”) (ASP) or $_GET['Tags'] (PHP) and then use the value returned in your database query.
/ Karl
Thanks Karl,
I am sorry but I might be missing something… Do you have an example of what you describe?
I am quite happy with posting form data and writing to the DB but the example you have doesn’t actually seem to use a form? Also, the tags are elements…
If I enclose it within a form, type the tag and press space (it adds the new tag to the div as an ) I don’t see any attempt to access my web server at the URL I specified in the form though.
Regards,
Graham
Yes they are elements when shown on the page. Though if you it put in a form-tag and then submit the form the script will create a comma-delimited string that is posted with the form.
Hi,
I have a problem you jQuery plugin. I have been using the same page CKEditor and, xajax submit.
I remove the problem goes CKEditor. but I have to use the same page. Thank you for your help.
Really a great plugin!
Simple and effective!
Thanks
Hi Karl,
I’ve found useful a simple change to make the plugin work also within ajax forms. In this case you’ll probably find form tags with filled “onsubmit” attribute, this will prevent the form.submit() event triggering.
This was the code before:
var form = $(this).parents(“form”);
form.submit(function() {
parse();
hiddenText.val(itemBase.join(options.separator));
hiddenText.attr(“id”, textBase.attr(“id”));
hiddenText.attr(“name”, textBase.attr(“name”));
textBase.attr(“id”, textBase.attr(“id”) + ‘_old’);
textBase.attr(“name”, textBase.attr(“name”) + ‘_old’);
});
and now:
var form = $(this).parents(“form”);
if (“” == form.attr(“onsubmit”)) {
form.submit(onSubmit);
}
else {
form.children(“[type=submit]“).click(onSubmit);
}
function onSubmit() {
parse();
hiddenText.val(itemBase.join(options.separator));
hiddenText.attr(“id”, textBase.attr(“id”));
hiddenText.attr(“name”, textBase.attr(“name”));
textBase.attr(“id”, textBase.attr(“id”) + ‘_old’);
textBase.attr(“name”, textBase.attr(“name”) + ‘_old’);
}
Bye
In the case where you have a lot of tags, say 20 tags, they seem to extend across the screen horizontally, as they are displayed “inline”. Is there a simple way to get them to drop down vertically? Perhaps even a blank LI with display set to “block” that is injected every X items?