[jQuery] Get label text
Hello, This might be a tricky one ... I have been looking into JQuery docs but I can't figure how to make this. I have the following: input type=checkbox name=Roles id=Admin value=Admin / label for=AdminAdministrator/label input type=checkbox name=Roles id=Coll value=Admin / label for=CollCollaborator/label How can I get, NOT the values, of all checked boxes BUT the label inner text of all checked boxes? Example: If Coll checkbox is checked I would get: Collaborator If both checkboxes are checked I would get: Collaborator, Administrator Could someone, please, help me? Thank You, Miguel
[jQuery] Re: Get label text
But I can join the labels can't I? I tried: .append(levels.join(', ')) to added it to an element and I get the error in Firebug: levels.join is not a function Am I doing something wrong? Thanks, Miguel On Oct 23, 9:57 pm, Klaus Hartl [EMAIL PROTECTED] wrote: You could try this (untested): var labels = $('input:checked + label').map(function() { return $(this).text(); }); That should give you an array with the label's text. --Klaus On 23 Okt., 22:47, shapper [EMAIL PROTECTED] wrote: Hello, This might be a tricky one ... I have been looking into JQuery docs but I can't figure how to make this. I have the following: input type=checkbox name=Roles id=Admin value=Admin / label for=AdminAdministrator/label input type=checkbox name=Roles id=Coll value=Admin / label for=CollCollaborator/label How can I get, NOT the values, of all checked boxes BUT the label inner text of all checked boxes? Example: If Coll checkbox is checked I would get: Collaborator If both checkboxes are checked I would get: Collaborator, Administrator Could someone, please, help me? Thank You, Miguel
[jQuery] Re: Get label text
yes, I have: var levels = []; levels = $('input:checked + label').map(function() { return $(this).text(); }); ... .append(levels.join(',')) Still having the same error ... On Oct 24, 1:04 am, William [EMAIL PROTECTED] wrote: Perhaps use .append(labels.join(',')) Note that the snippet from Klaus uses var *labels*, so trying to use the Array.join method of *levels* (probably undefined) will likely not work ;) On Oct 23, 2:58 pm, shapper [EMAIL PROTECTED] wrote: But I can join the labels can't I? I tried: .append(levels.join(', ')) to added it to an element and I get the error in Firebug: levels.join is not a function Am I doing something wrong? Thanks, Miguel On Oct 23, 9:57 pm, Klaus Hartl [EMAIL PROTECTED] wrote: You could try this (untested): var labels = $('input:checked + label').map(function() { return $(this).text(); }); That should give you an array with the label's text. --Klaus On 23 Okt., 22:47, shapper [EMAIL PROTECTED] wrote: Hello, This might be a tricky one ... I have been looking into JQuery docs but I can't figure how to make this. I have the following: input type=checkbox name=Roles id=Admin value=Admin / label for=AdminAdministrator/label input type=checkbox name=Roles id=Coll value=Admin / label for=CollCollaborator/label How can I get, NOT the values, of all checked boxes BUT the label inner text of all checked boxes? Example: If Coll checkbox is checked I would get: Collaborator If both checkboxes are checked I would get: Collaborator, Administrator Could someone, please, help me? Thank You, Miguel
[jQuery] Re: My first plugin ... need some help.
Hello, I uploaded the updated version: http://www.27lamps.com/Beta/List/List.html#remove There is only two problems: 1. The value of the select is not being added. 2. If i have multiple chekboxes on the same group I would like to add only the values of ones selected. The ideal would be to have the following format: Name. Country. 1st CheckBox selected, 2st CheckBox selected, ... This way I can understand that each dot separates an input and a comma separates the selected values of a check box group. How can I do this? Thanks, Miguel On Oct 22, 2:45 am, shapper [EMAIL PROTECTED] wrote: Hi, I will try it. Sorry, but I am no expert with JQuery and I am just trying to pull this off. I understand that a plugin should have many more options but my intention is to have this plugin so I can use across my projects and with time improve it. It would be easier to make this without being a plugin? I am not really sure how the code would change ... I was looking for such a plugin but I wasn't able to find any ... I think this is really useful. Just select the inputs, the button, the list and the format as the inputs values would be displayed. Then use something like: liBook Type. Book Name. Values of selected CheckBoxes separated by commasinput type=hidden name=myList value=Book Type. Book Name. Values of selected CheckBoxes separated by commas /a href=#removeclass=removeRemove Item/a/li Then I use the hidden inputs to read the info on the server after the form is submitted, parse the info and insert it into the database along with the other form info. Does this makes any sense? Yes, I could use Ajax but the form has a lot more information and these list info should be only saved into the database if the user submits the register form itself. So if i send this info through ajax there will no where to save it since the user didn't register yet. Is this what you meant? Thank You, Miguel On Oct 22, 1:45 am, ricardobeat [EMAIL PROTECTED] wrote: Install the Firebug extension for Firefox so you can debug your code easily:www.getfirebug.com I don't mean it's not good for a plug-in, I mean it's a very specific behaviour. To be useful to a large number of people it would need to be very flexible and customizable. On your test page, you forgot to close the function and you're not using it the right way. As it is you should have used: $('form').createList('#MyList') // form is the form from where you are getting the values, you pass createList() the list ID I changed it to act from the elements themselves, here is a new one: $(document).ready(function() { $.fn.createList = function(opt){ var origin = this.eq(0).parents('form'); var $fields = this; $(opt.button,origin).bind('click',function(){ str = []; $fields.each(function(){ str.push($(this).val()); }); str = str.join(','); $('li/li').appendTo(opt.list).append(str).append(' a href=#remove class=removeRemove Item/a'); return false; }); } }); The way you use this is the following: $('input.name,input.country,input.newsletter').createList({ list: '#MyList', button: 'input.sendToList' }) First you select the form inputs that you want to get the values from, then you call createList and pass an object specifying a selector for the list and for the button you want to use, they can be any selector (ID,class,etc). The code is quite self-explanatory. You could also send this data directly to the server via Ajax, there is no need to put it in a list just for that. cheers, Ricardo On Oct 21, 9:07 pm, shapper [EMAIL PROTECTED] wrote: Hi, I tried to follow your tips but I might be doing something wrong:http://www.27lamps.com/Beta/List/List.html A few questions: 1. Why isn't this good for a plugin? I fell this is really useful in forms for selecting multiple items, add them to the a list and then read that list from server side. 2. Can't I specify the ID's of the form inputs I want to take the info from? My form has 10 inputs and 2 buttons: One should submit the form. The other should only add the contents of the 3 selected inputs to the list. Thank You, Miguel On Oct 16, 9:47 pm, ricardobeat [EMAIL PROTECTED] wrote: This is quite specific to made into an actual plug-in, but here it goes: $.fn.createList = function(list){ var origin = this; $(':submit',origin).bind('click',function(){ str = []; console.log($('input,select,checkbox:checked',origin)); $('.name,.country,.newsletter:checked',origin).each(function(){ str.push($(this).val()); }); str = str.join(','); $('li/li').appendTo(list).append(str).append(' a href
[jQuery] Re: My first plugin ... need some help.
Hi, I solved problem 1 and updated my online example. I still have problems with the checkboxes and the display format ... any idea how to solve? Thanks, Miguel On Oct 23, 12:23 am, shapper [EMAIL PROTECTED] wrote: Hello, I uploaded the updated version:http://www.27lamps.com/Beta/List/List.html#remove There is only two problems: 1. The value of the select is not being added. 2. If i have multiple chekboxes on the same group I would like to add only the values of ones selected. The ideal would be to have the following format: Name. Country. 1st CheckBox selected, 2st CheckBox selected, ... This way I can understand that each dot separates an input and a comma separates the selected values of a check box group. How can I do this? Thanks, Miguel On Oct 22, 2:45 am, shapper [EMAIL PROTECTED] wrote: Hi, I will try it. Sorry, but I am no expert with JQuery and I am just trying to pull this off. I understand that a plugin should have many more options but my intention is to have this plugin so I can use across my projects and with time improve it. It would be easier to make this without being a plugin? I am not really sure how the code would change ... I was looking for such a plugin but I wasn't able to find any ... I think this is really useful. Just select the inputs, the button, the list and the format as the inputs values would be displayed. Then use something like: liBook Type. Book Name. Values of selected CheckBoxes separated by commasinput type=hidden name=myList value=Book Type. Book Name. Values of selected CheckBoxes separated by commas /a href=#removeclass=removeRemove Item/a/li Then I use the hidden inputs to read the info on the server after the form is submitted, parse the info and insert it into the database along with the other form info. Does this makes any sense? Yes, I could use Ajax but the form has a lot more information and these list info should be only saved into the database if the user submits the register form itself. So if i send this info through ajax there will no where to save it since the user didn't register yet. Is this what you meant? Thank You, Miguel On Oct 22, 1:45 am, ricardobeat [EMAIL PROTECTED] wrote: Install the Firebug extension for Firefox so you can debug your code easily:www.getfirebug.com I don't mean it's not good for a plug-in, I mean it's a very specific behaviour. To be useful to a large number of people it would need to be very flexible and customizable. On your test page, you forgot to close the function and you're not using it the right way. As it is you should have used: $('form').createList('#MyList') // form is the form from where you are getting the values, you pass createList() the list ID I changed it to act from the elements themselves, here is a new one: $(document).ready(function() { $.fn.createList = function(opt){ var origin = this.eq(0).parents('form'); var $fields = this; $(opt.button,origin).bind('click',function(){ str = []; $fields.each(function(){ str.push($(this).val()); }); str = str.join(','); $('li/li').appendTo(opt.list).append(str).append(' a href=#remove class=removeRemove Item/a'); return false; }); } }); The way you use this is the following: $('input.name,input.country,input.newsletter').createList({ list: '#MyList', button: 'input.sendToList' }) First you select the form inputs that you want to get the values from, then you call createList and pass an object specifying a selector for the list and for the button you want to use, they can be any selector (ID,class,etc). The code is quite self-explanatory. You could also send this data directly to the server via Ajax, there is no need to put it in a list just for that. cheers, Ricardo On Oct 21, 9:07 pm, shapper [EMAIL PROTECTED] wrote: Hi, I tried to follow your tips but I might be doing something wrong:http://www.27lamps.com/Beta/List/List.html A few questions: 1. Why isn't this good for a plugin? I fell this is really useful in forms for selecting multiple items, add them to the a list and then read that list from server side. 2. Can't I specify the ID's of the form inputs I want to take the info from? My form has 10 inputs and 2 buttons: One should submit the form. The other should only add the contents of the 3 selected inputs to the list. Thank You, Miguel On Oct 16, 9:47 pm, ricardobeat [EMAIL PROTECTED] wrote: This is quite specific to made into an actual plug-in, but here it goes: $.fn.createList = function(list){ var origin = this; $(':submit',origin).bind('click',function(){ str = []; console.log($('input
[jQuery] Re: My first plugin ... need some help.
Hi again, I changed the join to a dot and added [EMAIL PROTECTED] as a selector of my CheckBoxes group. I am trying that the values of the selected checkboxes to be added in a Comma Separated format. This is not working? Could someone, please, help me with this thing? It is the last thing to finish it. Thanks, Miguel On Oct 23, 1:05 am, shapper [EMAIL PROTECTED] wrote: Hi, I solved problem 1 and updated my online example. I still have problems with the checkboxes and the display format ... any idea how to solve? Thanks, Miguel On Oct 23, 12:23 am, shapper [EMAIL PROTECTED] wrote: Hello, I uploaded the updated version:http://www.27lamps.com/Beta/List/List.html#remove There is only two problems: 1. The value of the select is not being added. 2. If i have multiple chekboxes on the same group I would like to add only the values of ones selected. The ideal would be to have the following format: Name. Country. 1st CheckBox selected, 2st CheckBox selected, ... This way I can understand that each dot separates an input and a comma separates the selected values of a check box group. How can I do this? Thanks, Miguel On Oct 22, 2:45 am, shapper [EMAIL PROTECTED] wrote: Hi, I will try it. Sorry, but I am no expert with JQuery and I am just trying to pull this off. I understand that a plugin should have many more options but my intention is to have this plugin so I can use across my projects and with time improve it. It would be easier to make this without being a plugin? I am not really sure how the code would change ... I was looking for such a plugin but I wasn't able to find any ... I think this is really useful. Just select the inputs, the button, the list and the format as the inputs values would be displayed. Then use something like: liBook Type. Book Name. Values of selected CheckBoxes separated by commasinput type=hidden name=myList value=Book Type. Book Name. Values of selected CheckBoxes separated by commas /a href=#removeclass=removeRemove Item/a/li Then I use the hidden inputs to read the info on the server after the form is submitted, parse the info and insert it into the database along with the other form info. Does this makes any sense? Yes, I could use Ajax but the form has a lot more information and these list info should be only saved into the database if the user submits the register form itself. So if i send this info through ajax there will no where to save it since the user didn't register yet. Is this what you meant? Thank You, Miguel On Oct 22, 1:45 am, ricardobeat [EMAIL PROTECTED] wrote: Install the Firebug extension for Firefox so you can debug your code easily:www.getfirebug.com I don't mean it's not good for a plug-in, I mean it's a very specific behaviour. To be useful to a large number of people it would need to be very flexible and customizable. On your test page, you forgot to close the function and you're not using it the right way. As it is you should have used: $('form').createList('#MyList') // form is the form from where you are getting the values, you pass createList() the list ID I changed it to act from the elements themselves, here is a new one: $(document).ready(function() { $.fn.createList = function(opt){ var origin = this.eq(0).parents('form'); var $fields = this; $(opt.button,origin).bind('click',function(){ str = []; $fields.each(function(){ str.push($(this).val()); }); str = str.join(','); $('li/li').appendTo(opt.list).append(str).append(' a href=#remove class=removeRemove Item/a'); return false; }); } }); The way you use this is the following: $('input.name,input.country,input.newsletter').createList({ list: '#MyList', button: 'input.sendToList' }) First you select the form inputs that you want to get the values from, then you call createList and pass an object specifying a selector for the list and for the button you want to use, they can be any selector (ID,class,etc). The code is quite self-explanatory. You could also send this data directly to the server via Ajax, there is no need to put it in a list just for that. cheers, Ricardo On Oct 21, 9:07 pm, shapper [EMAIL PROTECTED] wrote: Hi, I tried to follow your tips but I might be doing something wrong:http://www.27lamps.com/Beta/List/List.html A few questions: 1. Why isn't this good for a plugin? I fell this is really useful in forms for selecting multiple items, add them to the a list and then read that list from server side. 2. Can't I specify the ID's of the form inputs I want to take the info from? My form has 10 inputs and 2 buttons: One should
[jQuery] Re: My first plugin ... need some help.
Hi, I tried to follow your tips but I might be doing something wrong: http://www.27lamps.com/Beta/List/List.html A few questions: 1. Why isn't this good for a plugin? I fell this is really useful in forms for selecting multiple items, add them to the a list and then read that list from server side. 2. Can't I specify the ID's of the form inputs I want to take the info from? My form has 10 inputs and 2 buttons: One should submit the form. The other should only add the contents of the 3 selected inputs to the list. Thank You, Miguel On Oct 16, 9:47 pm, ricardobeat [EMAIL PROTECTED] wrote: This is quite specific to made into an actual plug-in, but here it goes: $.fn.createList = function(list){ var origin = this; $(':submit',origin).bind('click',function(){ str = []; console.log($('input,select,checkbox:checked',origin)); $('.name,.country,.newsletter:checked',origin).each(function(){ str.push($(this).val()); }); str = str.join(','); $('li/li').appendTo(list).append(str).append(' a href=#remove class=removeRemove Item/a'); return false; }); }; form input class=name/ select class=country option value=FranceFrance/option option value=PortugalPortugal/option option value=UKUK/option option value=USUS/option /select input type=checkbox value=Newsletter class=newsletter name=newsletter/ input type=submit value=Add to List/ /form 1. you were binding the 'remove buttons' everytime you ran the function, keep the livequery call outside the function so it only runs once 2. your HTML was missing IDs, I made them into classes so you don't need to pass IDs everytime 3. 'this' inside your appendTo() was refering to the button, not the form only tested on FF3, works alright. - ricardo On Oct 16, 8:39 am, shapper [EMAIL PROTECTED] wrote: Hi, I added a live example to:http://www.27lamps.com/Beta/List/List.html It is not working. Could someone, please, help me with this? I am trying to create something similar to what is used in wordpress to add tags to a post but getting the values from multiple form inputs. Thanks, Miguel On Oct 16, 5:58 am, ricardobeat [EMAIL PROTECTED] wrote: If the ids are supplied in '#id,#otherid,#otherid' format, you could do: var str = new String; $(options.formids).each(function(){ str += $(this).val(); str += ',';}); $('li/').appendTo(options.listid).text(str); - ricardo On Oct 15, 9:49 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am trying to create my first JQuery plugin that does the following: On a form, when a button is pressed, a few form elements values are used to create a string (CSV format). This string is added to an ordered list and with a remove button to remove it from the list. Could someone, please, help me making this work. What I have is: (function($) { $.fn.AddToList = function(options) { var defaults = { formids: input1, select1, input2, buttonId: submit, listId: items }; var options = $.extend(defaults, options); return this.each(function() { $('.Remove') .livequery('click', function(event) { $(this).parent().remove(); }); $(options.buttonId).bind('click', function() { $(options.listID).append(li??/li); }); }); }; })(jQuery); I created three parameters: formids: The ids of the form elements from where the content should be taken buttonId: The id of the button that triggers the adding of the form element values to the list listId: The listid where the items should be added. I am using LiveQuery to add the remove action to the button adding a class of Remove to all buttons. Thanks, Miguel
[jQuery] Re: My first plugin ... need some help.
Hi, I will try it. Sorry, but I am no expert with JQuery and I am just trying to pull this off. I understand that a plugin should have many more options but my intention is to have this plugin so I can use across my projects and with time improve it. It would be easier to make this without being a plugin? I am not really sure how the code would change ... I was looking for such a plugin but I wasn't able to find any ... I think this is really useful. Just select the inputs, the button, the list and the format as the inputs values would be displayed. Then use something like: liBook Type. Book Name. Values of selected CheckBoxes separated by commasinput type=hidden name=myList value=Book Type. Book Name. Values of selected CheckBoxes separated by commas /a href=#removeclass=removeRemove Item/a/li Then I use the hidden inputs to read the info on the server after the form is submitted, parse the info and insert it into the database along with the other form info. Does this makes any sense? Yes, I could use Ajax but the form has a lot more information and these list info should be only saved into the database if the user submits the register form itself. So if i send this info through ajax there will no where to save it since the user didn't register yet. Is this what you meant? Thank You, Miguel On Oct 22, 1:45 am, ricardobeat [EMAIL PROTECTED] wrote: Install the Firebug extension for Firefox so you can debug your code easily:www.getfirebug.com I don't mean it's not good for a plug-in, I mean it's a very specific behaviour. To be useful to a large number of people it would need to be very flexible and customizable. On your test page, you forgot to close the function and you're not using it the right way. As it is you should have used: $('form').createList('#MyList') // form is the form from where you are getting the values, you pass createList() the list ID I changed it to act from the elements themselves, here is a new one: $(document).ready(function() { $.fn.createList = function(opt){ var origin = this.eq(0).parents('form'); var $fields = this; $(opt.button,origin).bind('click',function(){ str = []; $fields.each(function(){ str.push($(this).val()); }); str = str.join(','); $('li/li').appendTo(opt.list).append(str).append(' a href=#remove class=removeRemove Item/a'); return false; }); } }); The way you use this is the following: $('input.name,input.country,input.newsletter').createList({ list: '#MyList', button: 'input.sendToList' }) First you select the form inputs that you want to get the values from, then you call createList and pass an object specifying a selector for the list and for the button you want to use, they can be any selector (ID,class,etc). The code is quite self-explanatory. You could also send this data directly to the server via Ajax, there is no need to put it in a list just for that. cheers, Ricardo On Oct 21, 9:07 pm, shapper [EMAIL PROTECTED] wrote: Hi, I tried to follow your tips but I might be doing something wrong:http://www.27lamps.com/Beta/List/List.html A few questions: 1. Why isn't this good for a plugin? I fell this is really useful in forms for selecting multiple items, add them to the a list and then read that list from server side. 2. Can't I specify the ID's of the form inputs I want to take the info from? My form has 10 inputs and 2 buttons: One should submit the form. The other should only add the contents of the 3 selected inputs to the list. Thank You, Miguel On Oct 16, 9:47 pm, ricardobeat [EMAIL PROTECTED] wrote: This is quite specific to made into an actual plug-in, but here it goes: $.fn.createList = function(list){ var origin = this; $(':submit',origin).bind('click',function(){ str = []; console.log($('input,select,checkbox:checked',origin)); $('.name,.country,.newsletter:checked',origin).each(function(){ str.push($(this).val()); }); str = str.join(','); $('li/li').appendTo(list).append(str).append(' a href=#remove class=removeRemove Item/a'); return false; }); }; form input class=name/ select class=country option value=FranceFrance/option option value=PortugalPortugal/option option value=UKUK/option option value=USUS/option /select input type=checkbox value=Newsletter class=newsletter name=newsletter/ input type=submit value=Add to List/ /form 1. you were binding the 'remove buttons' everytime you ran the function, keep the livequery call outside the function so it only runs once 2. your HTML was missing IDs, I made them into classes so you don't need to pass IDs everytime 3
[jQuery] My first plugin ... need some help.
Hello, I am trying to create my first JQuery plugin that does the following: On a form, when a button is pressed, a few form elements values are used to create a string (CSV format). This string is added to an ordered list and with a remove button to remove it from the list. Could someone, please, help me making this work. What I have is: (function($) { $.fn.AddToList = function(options) { var defaults = { formids: input1, select1, input2, buttonId: submit, listId: items }; var options = $.extend(defaults, options); return this.each(function() { $('.Remove') .livequery('click', function(event) { $(this).parent().remove(); }); $(options.buttonId).bind('click', function() { $(options.listID).append(li??/li); }); }); }; })(jQuery); I created three parameters: formids: The ids of the form elements from where the content should be taken buttonId: The id of the button that triggers the adding of the form element values to the list listId: The listid where the items should be added. I am using LiveQuery to add the remove action to the button adding a class of Remove to all buttons. Thanks, Miguel
[jQuery] Form Fieldset
Hello, I have a form with 5 fieldsetss Does anyone knows how to do one of the following (or maybe a plugin)? 1. Collapse/Expand a fieldset when its legend is clicked. 2. Turn the fieldsets into tabs. When the form is submitted I should always have access to all form input values. Thanks, Miguel
[jQuery] List. Is this possible?
Hello, I have three inputs A, B and C and button. This is a group inside a form. When I click the button I want to add the information on the inputs into a list under the button. The information must be displayed as A ( B ) ( C ) and have a small button on the right to remove from list. When the form is submitted I would like to be able to get all items in the list in order to parse them and create data in my server side code. How can I create this list functionality? Thank You, Miguel
[jQuery] Find elements
Hello, How can I find all elements in a page given a class and pass to a function? Or maybe better, how to I create a function that acts like a plugin, i.e.: Applies something to all elements of a given class. Thanks, Miguel
[jQuery] Separate elements
Hello, I am trying to create a plugin that applies something to elements given their CSS class. However, I need to distinguish between the elements that are enabled and the elements which has the property disabled = 'disabled' ... I need this because what I apply is different dependent of being enabled and disabled. Thanks, Miguel
[jQuery] Re: Css Class - Parameter
Please, anyone? Thank You, Miguel On Sep 15, 3:55 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using the following DatePicker plugin:http://www.kelvinluck.com/assets/jquery/datePicker/v2/jquery.datePick... Most CSSClasses, for example jCalendar, are built into the plugin. I need to make that parameters. Could someone, please, give me an example with the jCalendar css class, of how to make it a plugin's parameter. I have been trying a few changes but was never able to make this work. Thank You, Miguel
[jQuery] Re: TinyMCE and JQuery
I also found the following: http://dev.jquery.com/wiki/Plugins/tinyMCE What do you think? Which approach should I use? Any advice from anyone is welcome ... Thank You, Miguel On Sep 13, 7:17 am, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote: shapper ha scritto: Hello, I want to add TinyMCE to the TextAreas with classes A and B that show in my pages. TinyMCE allows only to apply it by ID's or to all Text Areas. How can I apply TinyMCE using JQuery to TextAreas by CSS Class? Thanks, Miguel I've used this way: (every textarea of class a must have a single id) elems = ''; $('.a').each(function() { if(elems !='') { elems += ','; } elems += this.id; }); initTinymce(elems); function initTinymce(elems) { var elems; if(typeof(elems) == 'undefined') { mode = 'textareas'; elems = ''; } else { mode = 'exact'; } tinyMCE.init({ theme : advanced, mode : mode, elements : elems, . }); } -- gianiaz.net - web solutions p.le bertacchi 66, 23100 sondrio (so) - italy +39 347 7196482
[jQuery] Plugin Inputs
Hello, I am using the following DatePicker plugin: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html I want to add extra inputs ... I mean, instead of the Date Picker CSS Classes being defined in the plugin I want to set default values and add them as inputs of the plugin ... Could someone, please, show me an example of how to do this so I understand what changes do I need to make on my code? Thanks, Miguel
[jQuery] Re: Id not Found
I tried it ... but I wanted to ask just to cover all the situations. I needed to be sure ... Thank You! Miguel On Sep 12, 2:51 pm, MorningZ [EMAIL PROTECTED] wrote: Will I create any problem to a page or fire any error if I apply a JQuery plugin to an id that does not exist? Why not *just try it* and see what happens? wouldn't that have been faster/easier than making a post about it?
[jQuery] Child ID
Hello, I have the following: $(#StartDate, #FinishDate).each(function() { $(this).mask(-99-99 99:99:99); }); It is working but I want to apply this only to StartDate and FinishDate inputs that are inside the form with id Create. How can I do this? Thanks. Miguel
[jQuery] Re: Child ID
The problem is not exactly that ... I am developing a MVC application ... for example, PostController has views: Create, Destroy and Edit. All views have a form named Create, Destroy and Edit. Most forms have common JQuery scripts: ToolTip, FileStyle, etc ... However, in some cases they differ ... So to differentiate these cases I include the form id. Does this make any sense? I am using a single file named Post.js ... Yes, I could and I have used 1 file per view ... However, consider I have 20 controllers having an average of 4 views ... that gives me 80 js files ... hard do mantain. So I am creating a single js file for each controller associated to all its views ... Does this make any sense? Thanks, Miguel On Sep 12, 4:42 pm, MorningZ [EMAIL PROTECTED] wrote: $(#StartDate, #FinishDate, form#Create).each(function() { $(this).mask(-99-99 99:99:99); }); but to note, ID's should be unique in the page, so having html body form id=Form1 input type=text id=StartDate / input type=text id=EndDate / /form form id=Create input type=text id=StartDate / input type=text id=EndDate / /form /body /html doesn't semantically make sense (and isn't 'valid HTML' to boot) Why not just use a css class to denote which you want to mask?
[jQuery] Re: ToolTip Bassistance. Not working as expected ...
Hi, I corrected and styles my ToolTip ... However, if you note that is still a problem with the Input of type file ... it only shows the tooltip over the styled browse button and not over the input. Do you know what I need to do to solve this? Thanks, Miguel On Sep 11, 9:03 am, TheBoyaci [EMAIL PROTECTED] wrote: Hi Miguel, try set the element style position:absolute which id is tooltip. #tooltip{ position:absolute; } On 11 Eylül, 04:18, shapper [EMAIL PROTECTED] wrote: Hello, Please check my form:http://www.27lamps.com/Beta/FileStyleValidate/FileStyleValidate.html Why does the ToolTip over the Title input shows on the bottom? And why the ToolTip for the input of type file does not even show? How can I solve this- Thanks, Miguel
[jQuery] Re: ToolTip Bassistance. Not working as expected ...
I just changed the plugin and it worked great! Thank You Very Much! Miguel On Sep 11, 1:27 pm, TheBoyaci [EMAIL PROTECTED] wrote: Hi, you use FileStyle plugin so that this plugin change your file input label for=PathFile/label ++added by FileStyle plugin input class=file style=display: inline; width: 320px; alt=/ and wrapped your input file by FileStyle plugin div style=background: transparent url(FileUpload_Button.jpg) no- repeat scroll right center; overflow: hidden; width: 20px; height: 15px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz- initial; -moz-background-inline-policy: -moz-initial; display: inline; position: absolute; input type=file value= name=Path id=Path style=position: relative; height: 15px; width: 320px; display: inline; cursor: pointer; opacity: 0; margin-left: -142px; alt=/ /div So you will try this code $(input[type=file]).filestyle({ image: FileUpload_Button.jpg, imageheight: 15, imagewidth: 20, width: 320 }); ++add $(.file).attr('title','Select a file'); because this input which has file class created by FileStyle plugin or you can change this plugin code at line 43-49 43 var filename = $('input class=file') 44 .addClass($(self).attr(class)) 45 .css({ 46 display: inline, 47 width: settings.width + px 48 }) 49 +++add .attr('title',$(self).attr(title)); On 11 Eylül, 14:21, shapper [EMAIL PROTECTED] wrote: Hi, I corrected and styles my ToolTip ... However, if you note that is still a problem with the Input of type file ... it only shows the tooltip over the styled browse button and not over the input. Do you know what I need to do to solve this? Thanks, Miguel On Sep 11, 9:03 am, TheBoyaci [EMAIL PROTECTED] wrote: Hi Miguel, try set the element style position:absolute which id is tooltip. #tooltip{ position:absolute; } On 11 Eylül, 04:18, shapper [EMAIL PROTECTED] wrote: Hello, Please check my form:http://www.27lamps.com/Beta/FileStyleValidate/FileStyleValidate.html Why does the ToolTip over the Title input shows on the bottom? And why the ToolTip for the input of type file does not even show? How can I solve this- Thanks, Miguel
[jQuery] ToolTip Bassistance and TinyMCE
Hello, I am trying to make the ToolTip Bassistance to work with TinyMCE: http://tinymce.moxiecode.com/examples/full.php I want to display a message when the user places the mouse on the content area which renders as follows: body id=tinymce class=mceContentBody spellcheck=false title=this is the title dir=ltr The content area is inside an IFrame. I used the following: $($mceContentBody).tooltip(); or $($tinymce).tooltip(); But it is not working. Could someone help me in solving this? Thanks, Miguel
[jQuery] Validate Problem. Online Example. Please, help me out ...
Hello, Please, check my online example: http://www.27lamps.com/Beta/FileStyleValidate/FileStyleValidate.html I am using FileStyle (http://www.appelsiini.net/projects/filestyle) to style the input of type file.. Both form inputs are required. If you submit the form you will see the Title required message but not the File required message. If you inspect the element with Firebug you will see that the File required message was added to the markup. I think I need to change the place where it is added but I wasn't able to do this by adding: errorPlacement: function(error, element) { if (element.is(input[type=file])) error.insertAfter(element.next()); else error.insertAfter(element); }, Could someone, please, help me out? Thanks, Miguel
[jQuery] Re: Validate and FileStyle problem. Could someone, please, help me out?
Please, anyone? I am on this for 2 days ... Thanks, Miguel On Sep 8, 6:34 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using JQuery Validate plugin to validate a input of type file. I am also styling the same input using FileStyle plugin:http://www.appelsiini.net/projects/filestyle The error message is added to the HTML markup but it is not visible. The generated HTML code is: label for=PathFicheiro/label input class=file style=display: inline; width: 320px;/ div style=background: transparent url(../Image/FileUpload.jpg) no-repeat scroll right center; overflow: hidden; width: 20px; height: 15px; -moz-background-clip: -moz-initial;- moz-background-origin: -moz-initial; -moz-background-inline-policy: - moz-initial; display: inline; position: absolute; input id=Path class= type=file value= name=Path style=position: relative; height: 15px; width: 320px; display:inline; cursor: pointer; opacity: 0; margin-left: -142px;/ label class=Error for=Path generated=trueSelect a document/label /div I am using the following code: $(input[type=file]).filestyle({ image: ../Image/FileUpload.jpg, imageheight: 15, imagewidth: 20, width: 320 }); $(#Create).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(input[type=file])) error.insertAfter(element.next()); else error.insertAfter(element); }, rules: { Path: { accept: flv|gif|jpg|png|swf, required: true } }, messages: { Path: { accept: Use only files with the following extensions flv, gif, jpg, png ou swf, required: Select a document } } }); Could someone, please, help me in solving this problem? Thanks, Miguel
[jQuery] Re: Validate Input of type File
Please, anyone? Thanks, Miguel On Sep 7, 10:57 pm, shapper [EMAIL PROTECTED] wrote: Hi, I tried and it is working ... well kind of. I am using FileStyle JQuery plugin to style the file input:http://www.appelsiini.net/projects/filestyle So the generated code (note the error message that is working): label for=PathFicheiro/label input class=file style=display: inline; width: 320px;/ div style=background: transparent url(../../Assets/Image/PT/ FileUpload_Button.jpg) no-repeat scroll right center; overflow: hidden; width: 20px; height: 15px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: - moz-initial; display: inline; position: absolute; input id=Path class= type=file value= name=Path style=position: relative; height: 15px; width: 320px; display: inline; cursor: pointer; opacity: 0; margin-left: -142px;/ label class=Error for=Path generated=trueSelect a document/label /div The error message is in the HTML markup as you can see but it is not visible. Any idea of how to solve this? Thanks, Miguel On Sep 7, 10:48 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Yes, just check the input value. You could use the validation plugin for that:http://bassistance.de/jquery-plugins/jquery-plugin-validation/ The demo here has two file inputs that get validated:http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html Jörn On Sat, Sep 6, 2008 at 11:39 PM, shapper [EMAIL PROTECTED] wrote: Hello, Is it possible to validate a input of type File? I mean that I would like to test if the user checked a file ... nothing else. Thanks, Miguel
[jQuery] Re: Validate Input of type File
I tried to add the following: errorPlacement: function(error, element) { if (element.is(input[type=file])) error.insertAfter(element.next()); else error.insertAfter(element); }, But still does not work. Could someone tell me how to solve this problem? Thanks, Miguel On Sep 8, 7:30 am, shapper [EMAIL PROTECTED] wrote: Please, anyone? Thanks, Miguel On Sep 7, 10:57 pm, shapper [EMAIL PROTECTED] wrote: Hi, I tried and it is working ... well kind of. I am using FileStyle JQuery plugin to style the file input:http://www.appelsiini.net/projects/filestyle So the generated code (note the error message that is working): label for=PathFicheiro/label input class=file style=display: inline; width: 320px;/ div style=background: transparent url(../../Assets/Image/PT/ FileUpload_Button.jpg) no-repeat scroll right center; overflow: hidden; width: 20px; height: 15px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: - moz-initial; display: inline; position: absolute; input id=Path class= type=file value= name=Path style=position: relative; height: 15px; width: 320px; display: inline; cursor: pointer; opacity: 0; margin-left: -142px;/ label class=Error for=Path generated=trueSelect a document/label /div The error message is in the HTML markup as you can see but it is not visible. Any idea of how to solve this? Thanks, Miguel On Sep 7, 10:48 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Yes, just check the input value. You could use the validation plugin for that:http://bassistance.de/jquery-plugins/jquery-plugin-validation/ The demo here has two file inputs that get validated:http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html Jörn On Sat, Sep 6, 2008 at 11:39 PM, shapper [EMAIL PROTECTED] wrote: Hello, Is it possible to validate a input of type File? I mean that I would like to test if the user checked a file ... nothing else. Thanks, Miguel
[jQuery] Validate and FileStyle problem. Could someone, please, help me out?
Hello, I am using JQuery Validate plugin to validate a input of type file. I am also styling the same input using FileStyle plugin: http://www.appelsiini.net/projects/filestyle The error message is added to the HTML markup but it is not visible. The generated HTML code is: label for=PathFicheiro/label input class=file style=display: inline; width: 320px;/ div style=background: transparent url(../Image/FileUpload.jpg) no-repeat scroll right center; overflow: hidden; width: 20px; height: 15px; -moz-background-clip: -moz-initial;- moz-background-origin: -moz-initial; -moz-background-inline-policy: - moz-initial; display: inline; position: absolute; input id=Path class= type=file value= name=Path style=position: relative; height: 15px; width: 320px; display:inline; cursor: pointer; opacity: 0; margin-left: -142px;/ label class=Error for=Path generated=trueSelect a document/label /div I am using the following code: $(input[type=file]).filestyle({ image: ../Image/FileUpload.jpg, imageheight: 15, imagewidth: 20, width: 320 }); $(#Create).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(input[type=file])) error.insertAfter(element.next()); else error.insertAfter(element); }, rules: { Path: { accept: flv|gif|jpg|png|swf, required: true } }, messages: { Path: { accept: Use only files with the following extensions flv, gif, jpg, png ou swf, required: Select a document } } }); Could someone, please, help me in solving this problem? Thanks, Miguel
[jQuery] Re: Validate Input of type File
Hi, I tried and it is working ... well kind of. I am using FileStyle JQuery plugin to style the file input: http://www.appelsiini.net/projects/filestyle So the generated code (note the error message that is working): label for=PathFicheiro/label input class=file style=display: inline; width: 320px;/ div style=background: transparent url(../../Assets/Image/PT/ FileUpload_Button.jpg) no-repeat scroll right center; overflow: hidden; width: 20px; height: 15px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: - moz-initial; display: inline; position: absolute; input id=Path class= type=file value= name=Path style=position: relative; height: 15px; width: 320px; display: inline; cursor: pointer; opacity: 0; margin-left: -142px;/ label class=Error for=Path generated=trueSelect a document/label /div The error message is in the HTML markup as you can see but it is not visible. Any idea of how to solve this? Thanks, Miguel On Sep 7, 10:48 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Yes, just check the input value. You could use the validation plugin for that:http://bassistance.de/jquery-plugins/jquery-plugin-validation/ The demo here has two file inputs that get validated:http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html Jörn On Sat, Sep 6, 2008 at 11:39 PM, shapper [EMAIL PROTECTED] wrote: Hello, Is it possible to validate a input of type File? I mean that I would like to test if the user checked a file ... nothing else. Thanks, Miguel
[jQuery] Validate Input of type File
Hello, Is it possible to validate a input of type File? I mean that I would like to test if the user checked a file ... nothing else. Thanks, Miguel
[jQuery] MaskedInput
Hello, I am applying a masked input to an input as follows: jQuery(function($) { $(#UpdatedAt).mask(-99-99 99:99:99); }); How can I apply the same mask to various inputs without needing to rewrite the code? I tried the following but it did not work: // Form mask jQuery(function($) { $(#UpdatedAt, #CreatedAt).mask(-99-99 99:99:99); }); Thanks, Miguel
[jQuery] Date and Time
Hello, Is it possible to get the Date and Time of a user and convert it to UTC using JQuery? I need to find the time zone of the user to display the server time in that time zone and when the user inserts a date and time convert it back to UTC to place it in the database. Thanks, Miguel
[jQuery] Re: File Upload
The ExtJS FileUploadField seems a good solution ... a custom Browse buttom with a read only path field. All customized. Does anyone knows how to turn this into JQuery? I have been reading SWFUpload but I can't want to use Flash. I have also see the FileStyle JQuery Plugin but it only styles the button ... Thank You, Miguel On Aug 28, 4:18 am, rudy ub [EMAIL PROTECTED] wrote: I've seen it on ExtJS FileUploadField example:http://extjs.com/deploy/dev/examples/form/file-upload.html On Thu, Aug 28, 2008 at 8:46 AM, shapper [EMAIL PROTECTED] wrote: Hi, Does anyone knows how to style and input of type file with JQuery? I want to use an image as the button or maybe a simple normal input styled with CSS. I also want to style the input where the path is ... I want it to have a grey background and no border. Any idea of how to accomplish this? Thanks, Miguel
[jQuery] File Upload
Hi, Does anyone knows how to style and input of type file with JQuery? I want to use an image as the button or maybe a simple normal input styled with CSS. I also want to style the input where the path is ... I want it to have a grey background and no border. Any idea of how to accomplish this? Thanks, Miguel
[jQuery] Re: [validate] Remote Validation
My input id is Name and the remote method is Check so the request is Check?Name=Something Can I change the Name to, for example, TagName in the request, without needing to change the id of the input? Thanks, Miguel On Aug 22, 9:16 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Yes, thats possible. Something like this works: $.validator.addMethod(custom, function(value, element) { if (invalid(value) { this.settings.messages[element.name] = my custom message; return false; } return true; }, default message); That works best when you have only that custom method as a rule. Mixing it with other methods gets a bit more complicated, you have to assign the custom message to messages[element.name].custom, and check first messages[element.name] is defined. Jörn On Fri, Aug 22, 2008 at 4:17 AM, shapper [EMAIL PROTECTED] wrote: Hi Jörn, It worked fine ... just a suggestion: What about the custom method to return the error message? This way a value could be checked in many ways and displaying a more accurate message for each error. Is this possible? Thanks, Miguel On Aug 21, 9:39 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Custom remote methods are currently not supported. You'd need to replicate the current implementation and change the necessary details - not recommended. There are various options for customizing message display, but using animations isn't supported either. You could give the highlight/unhighlight and showErrors options a try. In any case you'd have to familarize yourself with the validation plugin a lot, its way beyond what I can help with on this list. Jörn On Thu, Aug 21, 2008 at 10:07 PM, linocarvalho [EMAIL PROTECTED] wrote: Hello, I have one more question about this, I want to know if could override the default remote function creating another function that calls a $.ajax with method POST and has effects fadeIn() and fadeOut() when validating a INPUT. For example: remote: function(value, element, param) { $.ajax({ type: POST, url: /sys/check- email.php, dataType: json, data: email= + $ (#EMAIL).val(), beforeSend: function() { $(#load- email).fadeIn(); }, success: function(result) { $(#load- email).fadeOut(); return result; } ); But this function is not working how I expect. The effects works properly but I can still submit the form if the e-mail is not valid. Any suggestions is welcome. Thanks, Lino On 21 ago, 15:19, Jörn Zaefferer [EMAIL PROTECTED] wrote: Yes, seehttp://docs.jquery.com/Plugins/Validation/Methods/remote#url Jörn On Thu, Aug 21, 2008 at 6:48 PM, shapper [EMAIL PROTECTED] wrote: Hello, Can I validate a input using a remote function on my server side code? I could return a JSon from my server side code with True or False ... Could someone tell me how should I do this? Thanks, Miguel- Ocultar texto entre aspas - - Mostrar texto entre aspas -
[jQuery] AutoComplete. Show List
Hello, Can I open the AutoComplete list by clicking an image next to my input? For example, if the user does not write anything but wants to see all AutoComplete options then would click that icon on the right of the input ... Thanks, Miguel
[jQuery] AutoComplete Width
Hello, How do I define the AutoComplete panel to a fixed width? I tried to do it in the CSS by adding it to Results but it does not work ... Thanks, Miguel
[jQuery] Re: AutoComplete Width
I notice there is a Width property but I would like the Autocomplete to have the same width of the input which is 34em (I am using ems). I tried it but it does not work ... any idea? Thanks, Miguel On Aug 22, 11:34 pm, shapper [EMAIL PROTECTED] wrote: Hello, How do I define the AutoComplete panel to a fixed width? I tried to do it in the CSS by adding it to Results but it does not work ... Thanks, Miguel
[jQuery] [validate] Remote Validation
Hello, Can I validate a input using a remote function on my server side code? I could return a JSon from my server side code with True or False ... Could someone tell me how should I do this? Thanks, Miguel
[jQuery] Multi Select
Hello, I have an input where a user inserts Tags in a CSV way. However, I think it would be better to use a MultiSelect. Does anyone knows something like this in JQuery? Thanks, Miguel
[jQuery] Re: [validate] Remote Validation
Hi Jörn, It worked fine ... just a suggestion: What about the custom method to return the error message? This way a value could be checked in many ways and displaying a more accurate message for each error. Is this possible? Thanks, Miguel On Aug 21, 9:39 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Custom remote methods are currently not supported. You'd need to replicate the current implementation and change the necessary details - not recommended. There are various options for customizing message display, but using animations isn't supported either. You could give the highlight/unhighlight and showErrors options a try. In any case you'd have to familarize yourself with the validation plugin a lot, its way beyond what I can help with on this list. Jörn On Thu, Aug 21, 2008 at 10:07 PM, linocarvalho [EMAIL PROTECTED] wrote: Hello, I have one more question about this, I want to know if could override the default remote function creating another function that calls a $.ajax with method POST and has effects fadeIn() and fadeOut() when validating a INPUT. For example: remote: function(value, element, param) { $.ajax({ type: POST, url: /sys/check- email.php, dataType: json, data: email= + $ (#EMAIL).val(), beforeSend: function() { $(#load- email).fadeIn(); }, success: function(result) { $(#load- email).fadeOut(); return result; } ); But this function is not working how I expect. The effects works properly but I can still submit the form if the e-mail is not valid. Any suggestions is welcome. Thanks, Lino On 21 ago, 15:19, Jörn Zaefferer [EMAIL PROTECTED] wrote: Yes, seehttp://docs.jquery.com/Plugins/Validation/Methods/remote#url Jörn On Thu, Aug 21, 2008 at 6:48 PM, shapper [EMAIL PROTECTED] wrote: Hello, Can I validate a input using a remote function on my server side code? I could return a JSon from my server side code with True or False ... Could someone tell me how should I do this? Thanks, Miguel- Ocultar texto entre aspas - - Mostrar texto entre aspas -
[jQuery] Re: AutoComplete
The JSon method is always returning a simple array: [First,Second] Do I need to parse it? I tried but it does not work. I then tried: $(#Subjects).autocomplete(GetSubjects, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260 }); But it does not work to. Any idea? Thanks, Miguel On Jul 22, 1:02 am, shapper [EMAIL PROTECTED] wrote: Hello, I have a JQuery AutoComplete thats gets the value using JSon. Using Firebug I see that the values are being returned in the right way: [First,Second] But I get an error: value is undefined highlight()()JQuery.A...mplete.js (line 409) fillList()JQuery.A...mplete.js (line 648) display()()JQuery.A...mplete.js (line 666) receiveData()JQuery.A...mplete.js (line 316) success()()JQuery.A...mplete.js (line 355) success()JQuery.js (line 2818) onreadystatechange()()JQuery.js (line 2773) [Break on this error] return value.replace(new RegExp((?![^...^;] +;), gi), strong$1/strong); My AutoComplete is as follows: $(#Subjects).autocomplete(GetSubjects, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Value, result: row.Value } }); }, formatItem: function(item) { return item.Value; } }); What am I doing wrong? Thanks, Miguel
[jQuery] Select
Hello, I am trying to style my form inputs, textareas and selects as follows: input, select, textarea { border: solid 6px #ECF0F9; color: #252525; font: normal 0.75em Verdana, Geneva, sans-serif; padding: 0.25em; width: 520px; } I am having a few problems: Firefox 3: 1. The select is narrow than the inputs and textareas; 2. When I click the select the dropdown borders look different ... some are thinner than others. IE 7: 1. The select is narrow than the inputs and textareas; 2. The border of the select is not changed. What am I doing wrong and how can I make the appearance of a Select look the same across various browsers? Can I do this with JQuery? Thanks, Miguel
[jQuery] Re: Select
I already use a Reset. But I tried the YUI Reset and nothing changes. On Jul 21, 8:20 pm, Jake McGraw [EMAIL PROTECTED] wrote: On Mon, Jul 21, 2008 at 3:15 PM, shapper [EMAIL PROTECTED] wrote: Hello, I am trying to style my form inputs, textareas and selects as follows: Try using yui-css-reset and yui-css-base. These CSS files will strip all most of the default styling set by the browser. Check it out here: http://developer.yahoo.com/yui/reset/ - jake input, select, textarea { border: solid 6px #ECF0F9; color: #252525; font: normal 0.75em Verdana, Geneva, sans-serif; padding: 0.25em; width: 520px; } I am having a few problems: Firefox 3: 1. The select is narrow than the inputs and textareas; 2. When I click the select the dropdown borders look different ... some are thinner than others. IE 7: 1. The select is narrow than the inputs and textareas; 2. The border of the select is not changed. What am I doing wrong and how can I make the appearance of a Select look the same across various browsers? Can I do this with JQuery? Thanks, Miguel
[jQuery] Re: Select
why focus? On Jul 21, 9:16 pm, Angel Marquez [EMAIL PROTECTED] wrote: input:focus { } On Mon, Jul 21, 2008 at 12:20 PM, Jake McGraw [EMAIL PROTECTED] wrote: On Mon, Jul 21, 2008 at 3:15 PM, shapper [EMAIL PROTECTED] wrote: Hello, I am trying to style my form inputs, textareas and selects as follows: Try using yui-css-reset and yui-css-base. These CSS files will strip all most of the default styling set by the browser. Check it out here: http://developer.yahoo.com/yui/reset/ - jake input, select, textarea { border: solid 6px #ECF0F9; color: #252525; font: normal 0.75em Verdana, Geneva, sans-serif; padding: 0.25em; width: 520px; } I am having a few problems: Firefox 3: 1. The select is narrow than the inputs and textareas; 2. When I click the select the dropdown borders look different ... some are thinner than others. IE 7: 1. The select is narrow than the inputs and textareas; 2. The border of the select is not changed. What am I doing wrong and how can I make the appearance of a Select look the same across various browsers? Can I do this with JQuery? Thanks, Miguel
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Hi Jörn, Thank you for your help ... In fact I had that before but it was not working so I changed ... I realized it now that there were two problems: That one on my AutoComplete code and another one on the methods that returns the JSON when connecting to the SQL Server. I was able to spot it using FireBug. Thanks, Miguel On Jul 16, 8:18 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: The formatItem implementation is wrong. You are returning the JavaScript object for the row (item) instead of a String to display. Try return item.Name. Jörn On Wed, Jul 16, 2008 at 1:28 AM, shapper [EMAIL PROTECTED] wrote: Sorry for the delay ... I just changed the file. Check it now. On Jul 15, 9:37 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Firebug shows an error when I enter something. Can't debug it with the compressed script - replace that with the uncompressed one and we may get somewhere. Jörn On Tue, Jul 15, 2008 at 9:35 PM, shapper [EMAIL PROTECTED] wrote: Hi, Here it is: http://www.27lamps.com/Beta/AutoComplete/TagsUpdate.aspx And I kept the previous one: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx Thank You, Miguel On Jul 15, 6:09 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please put the commented code back in. The current one is rather useless. Jörn On Tue, Jul 15, 2008 at 4:31 PM, shapper [EMAIL PROTECTED] wrote: Does anyone knows how to solve this problem? Please, check my example in: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx On Jul 14, 9:57 pm, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded an ASP.NET application that shows exactly what the problem was. The commented script code is the one I used to try to solve my problem but it does not work: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx What should I do? Thanks, Miguel On Jul 14, 6:02 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Learn to use Firebug - as I mentioned, the ajax request returns a 404. It still does. Please come back when you have an actual JavaScript problem. Jörn On Mon, Jul 14, 2008 at 6:16 PM, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded all your example to my server and the json example does not work: http://www.27lamps.com/Labs/AutoComplete/demo/json.html None of the remote works ... have no idea why. The same happens with my example: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Anyway, all I am trying to make work is remote example where the JSON returned is as follows: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61- b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] I am not familiar with PHP but I created the following: ?php $q = strtolower($_GET[q]); if (!$q) return; echo [; echo {TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags: []},; echo {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags: [],ProfessorTags:[]},; echo {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},; echo {TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags: [],ProfessorTags:[]}]; echo ]; And my AutoComplete code is as follows: script type=text/javascript $(document).ready(function(){ $(#tag).autocomplete(tags.php, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); }); /script This is what I have been using to try to find the problem in AutoValidate so then I can fix the problem in my ASP.NET MVC project. Thanks, Miguel On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Open firebug
[jQuery] Uncompressed, Minified and Gzipped and Packed
Hello, Most JQuery plugins, including JQuery itseld, offer three versions: Uncompressed, Minified and Gzipped and Packed. 1. Should I use Minified and Gzipped or Packed? 2. How can I create myself the Minified and Gzipped or Packed versions from the Uncompressed version? Is there any software for this? Thank You, Miguel
[jQuery] AutoComplete Multiple Elements, Same Function
Hello, I have 3 inputs that use the same AutoComplete function. Can I make this work only with one command? I have: $(#Tags).autocomplete(GetTags, { autoFill: true ... I tried $(#Tags, #MoreTags).autocomplete(GetTags, { autoFill: true ... But it does not work. How can I do this? Thanks, Miguel
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Does anyone knows how to solve this problem? Please, check my example in: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx On Jul 14, 9:57 pm, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded an ASP.NET application that shows exactly what the problem was. The commented script code is the one I used to try to solve my problem but it does not work: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx What should I do? Thanks, Miguel On Jul 14, 6:02 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Learn to use Firebug - as I mentioned, the ajax request returns a 404. It still does. Please come back when you have an actual JavaScript problem. Jörn On Mon, Jul 14, 2008 at 6:16 PM, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded all your example to my server and the json example does not work: http://www.27lamps.com/Labs/AutoComplete/demo/json.html None of the remote works ... have no idea why. The same happens with my example: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Anyway, all I am trying to make work is remote example where the JSON returned is as follows: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61- b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] I am not familiar with PHP but I created the following: ?php $q = strtolower($_GET[q]); if (!$q) return; echo [; echo {TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags: []},; echo {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags: [],ProfessorTags:[]},; echo {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},; echo {TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags: [],ProfessorTags:[]}]; echo ]; And my AutoComplete code is as follows: script type=text/javascript $(document).ready(function(){ $(#tag).autocomplete(tags.php, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); }); /script This is what I have been using to try to find the problem in AutoValidate so then I can fix the problem in my ASP.NET MVC project. Thanks, Miguel On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Open firebug and look at the request being send. A 404 is returned. Jörn On Mon, Jul 14, 2008 at 5:15 PM, shapper [EMAIL PROTECTED] wrote: That was a mistake when I uploaded the files ... I sent two wrong files. I just updated the files: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Again it does not work. On Jul 14, 3:28 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You forgot the document ready code. Jörn On Mon, Jul 14, 2008 at 4:07 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 14, 1:04 am, shapper [EMAIL PROTECTED] wrote: Hi, I tried to replicate your code using the JSon string generated by ASP.NET MVC. I created a static php code as you did ... To be honest I am not familiar with php. This was the best I was able to do ... I have been trying everything to make this work ... I really don't understand why my AutoComplete does not work ... Here is the page I created:http://www.27lamps.com/Labs/AutoComplete/demo/tags.html I cannot guarantee that PHP code is ok ... I am really not used to it. My ASP.NET MVC application generates the following JSon string: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] This was what I tried to replicate. Does anyone has any idea how to solve my problem
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Hi, Here it is: http://www.27lamps.com/Beta/AutoComplete/TagsUpdate.aspx And I kept the previous one: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx Thank You, Miguel On Jul 15, 6:09 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please put the commented code back in. The current one is rather useless. Jörn On Tue, Jul 15, 2008 at 4:31 PM, shapper [EMAIL PROTECTED] wrote: Does anyone knows how to solve this problem? Please, check my example in: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx On Jul 14, 9:57 pm, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded an ASP.NET application that shows exactly what the problem was. The commented script code is the one I used to try to solve my problem but it does not work: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx What should I do? Thanks, Miguel On Jul 14, 6:02 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Learn to use Firebug - as I mentioned, the ajax request returns a 404. It still does. Please come back when you have an actual JavaScript problem. Jörn On Mon, Jul 14, 2008 at 6:16 PM, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded all your example to my server and the json example does not work: http://www.27lamps.com/Labs/AutoComplete/demo/json.html None of the remote works ... have no idea why. The same happens with my example: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Anyway, all I am trying to make work is remote example where the JSON returned is as follows: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61- b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] I am not familiar with PHP but I created the following: ?php $q = strtolower($_GET[q]); if (!$q) return; echo [; echo {TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags: []},; echo {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags: [],ProfessorTags:[]},; echo {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},; echo {TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags: [],ProfessorTags:[]}]; echo ]; And my AutoComplete code is as follows: script type=text/javascript $(document).ready(function(){ $(#tag).autocomplete(tags.php, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); }); /script This is what I have been using to try to find the problem in AutoValidate so then I can fix the problem in my ASP.NET MVC project. Thanks, Miguel On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Open firebug and look at the request being send. A 404 is returned. Jörn On Mon, Jul 14, 2008 at 5:15 PM, shapper [EMAIL PROTECTED] wrote: That was a mistake when I uploaded the files ... I sent two wrong files. I just updated the files: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Again it does not work. On Jul 14, 3:28 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You forgot the document ready code. Jörn On Mon, Jul 14, 2008 at 4:07 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 14, 1:04 am, shapper [EMAIL PROTECTED] wrote: Hi, I tried to replicate your code using the JSon string generated by ASP.NET MVC. I created a static php code as you did ... To be honest I am not familiar with php. This was the best I was able to do ... I have been trying everything to make this work ... I really don't understand why my AutoComplete does not work ... Here is the page I created:http://www.27lamps.com/Labs/AutoComplete/demo/tags.html I cannot guarantee that PHP code is ok ... I am really not used to it. My ASP.NET MVC application generates the following JSon
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Sorry for the delay ... I just changed the file. Check it now. On Jul 15, 9:37 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Firebug shows an error when I enter something. Can't debug it with the compressed script - replace that with the uncompressed one and we may get somewhere. Jörn On Tue, Jul 15, 2008 at 9:35 PM, shapper [EMAIL PROTECTED] wrote: Hi, Here it is: http://www.27lamps.com/Beta/AutoComplete/TagsUpdate.aspx And I kept the previous one: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx Thank You, Miguel On Jul 15, 6:09 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please put the commented code back in. The current one is rather useless. Jörn On Tue, Jul 15, 2008 at 4:31 PM, shapper [EMAIL PROTECTED] wrote: Does anyone knows how to solve this problem? Please, check my example in: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx On Jul 14, 9:57 pm, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded an ASP.NET application that shows exactly what the problem was. The commented script code is the one I used to try to solve my problem but it does not work: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx What should I do? Thanks, Miguel On Jul 14, 6:02 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Learn to use Firebug - as I mentioned, the ajax request returns a 404. It still does. Please come back when you have an actual JavaScript problem. Jörn On Mon, Jul 14, 2008 at 6:16 PM, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded all your example to my server and the json example does not work: http://www.27lamps.com/Labs/AutoComplete/demo/json.html None of the remote works ... have no idea why. The same happens with my example: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Anyway, all I am trying to make work is remote example where the JSON returned is as follows: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61- b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] I am not familiar with PHP but I created the following: ?php $q = strtolower($_GET[q]); if (!$q) return; echo [; echo {TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags: []},; echo {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags: [],ProfessorTags:[]},; echo {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},; echo {TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags: [],ProfessorTags:[]}]; echo ]; And my AutoComplete code is as follows: script type=text/javascript $(document).ready(function(){ $(#tag).autocomplete(tags.php, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); }); /script This is what I have been using to try to find the problem in AutoValidate so then I can fix the problem in my ASP.NET MVC project. Thanks, Miguel On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Open firebug and look at the request being send. A 404 is returned. Jörn On Mon, Jul 14, 2008 at 5:15 PM, shapper [EMAIL PROTECTED] wrote: That was a mistake when I uploaded the files ... I sent two wrong files. I just updated the files: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Again it does not work. On Jul 14, 3:28 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You forgot the document ready code. Jörn On Mon, Jul 14, 2008 at 4:07 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 14, 1:04 am, shapper [EMAIL PROTECTED] wrote: Hi, I tried to replicate your code using the JSon string generated by ASP.NET MVC. I
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Please, anyone? On Jul 14, 1:04 am, shapper [EMAIL PROTECTED] wrote: Hi, I tried to replicate your code using the JSon string generated by ASP.NET MVC. I created a static php code as you did ... To be honest I am not familiar with php. This was the best I was able to do ... I have been trying everything to make this work ... I really don't understand why my AutoComplete does not work ... Here is the page I created:http://www.27lamps.com/Labs/AutoComplete/demo/tags.html I cannot guarantee that PHP code is ok ... I am really not used to it. My ASP.NET MVC application generates the following JSon string: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] This was what I tried to replicate. Does anyone has any idea how to solve my problem? Thanks, Miguel On Jul 13, 9:44 pm, shapper [EMAIL PROTECTED] wrote: Hi, With ASP.NET this is not so easy ... Anyway, I tried to place your example and mine in the same page using PHP, which I am really not very familiar:http://www.27lamps.com/Labs/AutoComplete/AutoComplete.html Sorry, but I am not really use with PHP. Thanks, Miguel On Jul 13, 2:41 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You still haven't posted a testpage. It doesn't have to be dynamic, a static file that delivers the content that your serverside usually works just as well. Jörn On Sun, Jul 13, 2008 at 2:45 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 12, 6:46 pm, shapper [EMAIL PROTECTED] wrote: Hi, I can upload the client part but I am generating my JSON using ASP.NET MVC and the project is not finish so I can't upload it because it uses a SQL server. Don't you have any idea what is going on? I set up a page with this and I will try to explain what I get. When I use: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, selectFirst: false }); My autocomplete shows but only one option in the list ... however that option is including all the options returned by the Json according to that criteria. For example, if I type M I get one option which when selected puts the following in the input: [{TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]}] You see? It picks the two options. I tried again and typed F and I get: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}] Which is also right because I have only that record. So the server code is receiving well the parameter and returning the filtered records it but somehow the autocomplete interprets that as only one record and does not display it the right way ... I am using JSonResult of ASP.NET MVC to return the JSON and it seems to be ok. Any idea? Thanks, Miguel On Jul 12, 5:23 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please upload a testpage and provide a link. There are too many things that can go wrong here. Jörn On Sat, Jul 12, 2008 at 3:32 PM, shapper [EMAIL PROTECTED] wrote: Hi, I tried to make this work following your example but until now I wasn't able to make this work? Could you, please, help me out? This is what I have at the moment: $(#Tags).autocomplete(/File/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); My JSon data is as follows: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] What am I doing wrong? I have been trying many variations of my code but it still does not work. Thanks, Miguel On Jul 12, 12:05 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Remote json is still rather cumbersome to handle. Here is an example, take a look at the source:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html Jörn
[jQuery] Display JSon String
Hello, I have an URL which returns a JSon string. How can I display it on my page using JQuery? I need to check if the JSon returned is in the expected format. Thanks, Miguel
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Jörn, I just uploaded all your example to my server and the json example does not work: http://www.27lamps.com/Labs/AutoComplete/demo/json.html None of the remote works ... have no idea why. The same happens with my example: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Anyway, all I am trying to make work is remote example where the JSON returned is as follows: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61- b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] I am not familiar with PHP but I created the following: ?php $q = strtolower($_GET[q]); if (!$q) return; echo [; echo {TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags: []},; echo {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags: [],ProfessorTags:[]},; echo {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},; echo {TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags: [],ProfessorTags:[]}]; echo ]; And my AutoComplete code is as follows: script type=text/javascript $(document).ready(function(){ $(#tag).autocomplete(tags.php, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); }); /script This is what I have been using to try to find the problem in AutoValidate so then I can fix the problem in my ASP.NET MVC project. Thanks, Miguel On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Open firebug and look at the request being send. A 404 is returned. Jörn On Mon, Jul 14, 2008 at 5:15 PM, shapper [EMAIL PROTECTED] wrote: That was a mistake when I uploaded the files ... I sent two wrong files. I just updated the files: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Again it does not work. On Jul 14, 3:28 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You forgot the document ready code. Jörn On Mon, Jul 14, 2008 at 4:07 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 14, 1:04 am, shapper [EMAIL PROTECTED] wrote: Hi, I tried to replicate your code using the JSon string generated by ASP.NET MVC. I created a static php code as you did ... To be honest I am not familiar with php. This was the best I was able to do ... I have been trying everything to make this work ... I really don't understand why my AutoComplete does not work ... Here is the page I created:http://www.27lamps.com/Labs/AutoComplete/demo/tags.html I cannot guarantee that PHP code is ok ... I am really not used to it. My ASP.NET MVC application generates the following JSon string: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] This was what I tried to replicate. Does anyone has any idea how to solve my problem? Thanks, Miguel On Jul 13, 9:44 pm, shapper [EMAIL PROTECTED] wrote: Hi, With ASP.NET this is not so easy ... Anyway, I tried to place your example and mine in the same page using PHP, which I am really not very familiar:http://www.27lamps.com/Labs/AutoComplete/AutoComplete.html Sorry, but I am not really use with PHP. Thanks, Miguel On Jul 13, 2:41 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You still haven't posted a testpage. It doesn't have to be dynamic, a static file that delivers the content that your serverside usually works just as well. Jörn On Sun, Jul 13, 2008 at 2:45 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 12, 6:46 pm, shapper [EMAIL PROTECTED] wrote: Hi, I can upload the client part but I am generating my JSON using ASP.NET MVC and the project is not finish so I can't upload it because it uses a SQL server
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Jörn, I just uploaded an ASP.NET application that shows exactly what the problem was. The commented script code is the one I used to try to solve my problem but it does not work: http://www.27lamps.com/Beta/AutoComplete/Tags.aspx What should I do? Thanks, Miguel On Jul 14, 6:02 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Learn to use Firebug - as I mentioned, the ajax request returns a 404. It still does. Please come back when you have an actual JavaScript problem. Jörn On Mon, Jul 14, 2008 at 6:16 PM, shapper [EMAIL PROTECTED] wrote: Jörn, I just uploaded all your example to my server and the json example does not work: http://www.27lamps.com/Labs/AutoComplete/demo/json.html None of the remote works ... have no idea why. The same happens with my example: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Anyway, all I am trying to make work is remote example where the JSON returned is as follows: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61- b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] I am not familiar with PHP but I created the following: ?php $q = strtolower($_GET[q]); if (!$q) return; echo [; echo {TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags: []},; echo {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags: [],ProfessorTags:[]},; echo {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},; echo {TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags: [],ProfessorTags:[]}]; echo ]; And my AutoComplete code is as follows: script type=text/javascript $(document).ready(function(){ $(#tag).autocomplete(tags.php, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); }); /script This is what I have been using to try to find the problem in AutoValidate so then I can fix the problem in my ASP.NET MVC project. Thanks, Miguel On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Open firebug and look at the request being send. A 404 is returned. Jörn On Mon, Jul 14, 2008 at 5:15 PM, shapper [EMAIL PROTECTED] wrote: That was a mistake when I uploaded the files ... I sent two wrong files. I just updated the files: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html Again it does not work. On Jul 14, 3:28 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You forgot the document ready code. Jörn On Mon, Jul 14, 2008 at 4:07 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 14, 1:04 am, shapper [EMAIL PROTECTED] wrote: Hi, I tried to replicate your code using the JSon string generated by ASP.NET MVC. I created a static php code as you did ... To be honest I am not familiar with php. This was the best I was able to do ... I have been trying everything to make this work ... I really don't understand why my AutoComplete does not work ... Here is the page I created:http://www.27lamps.com/Labs/AutoComplete/demo/tags.html I cannot guarantee that PHP code is ok ... I am really not used to it. My ASP.NET MVC application generates the following JSon string: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] This was what I tried to replicate. Does anyone has any idea how to solve my problem? Thanks, Miguel On Jul 13, 9:44 pm, shapper [EMAIL PROTECTED] wrote: Hi, With ASP.NET this is not so easy ... Anyway, I tried to place your example and mine in the same page using PHP, which I am really not very familiar:http://www.27lamps.com/Labs
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Please, anyone? On Jul 12, 6:46 pm, shapper [EMAIL PROTECTED] wrote: Hi, I can upload the client part but I am generating my JSON using ASP.NET MVC and the project is not finish so I can't upload it because it uses a SQL server. Don't you have any idea what is going on? I set up a page with this and I will try to explain what I get. When I use: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, selectFirst: false }); My autocomplete shows but only one option in the list ... however that option is including all the options returned by the Json according to that criteria. For example, if I type M I get one option which when selected puts the following in the input: [{TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]}] You see? It picks the two options. I tried again and typed F and I get: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}] Which is also right because I have only that record. So the server code is receiving well the parameter and returning the filtered records it but somehow the autocomplete interprets that as only one record and does not display it the right way ... I am using JSonResult of ASP.NET MVC to return the JSON and it seems to be ok. Any idea? Thanks, Miguel On Jul 12, 5:23 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please upload a testpage and provide a link. There are too many things that can go wrong here. Jörn On Sat, Jul 12, 2008 at 3:32 PM, shapper [EMAIL PROTECTED] wrote: Hi, I tried to make this work following your example but until now I wasn't able to make this work? Could you, please, help me out? This is what I have at the moment: $(#Tags).autocomplete(/File/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); My JSon data is as follows: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] What am I doing wrong? I have been trying many variations of my code but it still does not work. Thanks, Miguel On Jul 12, 12:05 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Remote json is still rather cumbersome to handle. Here is an example, take a look at the source:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html Jörn On Sat, Jul 12, 2008 at 1:01 AM, shapper [EMAIL PROTECTED] wrote: I also tried the following but until now I wasn't able to make it work: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, formatResult: function(item) { return item.Name; } }); Please, does anyone knows how to do this? MyJson data is as follows: [{TagID:3fae2160-55f6-4dd0-b856-fd27f5d307e2,Name:John}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Jane}] I have been trying to solve this but until now I wasn't able ... Thanks, Miguel On Jul 11, 8:53 pm, shapper [EMAIL PROTECTED] wrote: Yes, I tried the following: $(#Tags).autocomplete(/File/GetTags, { width: 260, formatItem: function(item) { return item.Name; } }); But this is not working. Any idea? Thanks, Miguel On Jul 11, 7:03 pm, tlphipps [EMAIL PROTECTED] wrote: You need to use the formatResult option (I think that's the option name). It will allow you to format the data for display. On Jul 11, 12:08 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using JQuery AutoComplete with JSon. I created a function on my server code which return the data. However, when I start writing J in my Input I get the following: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] How to get only the names instead of this strange format? Am I a missing something here? Thanks, Miguel
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Hi, With ASP.NET this is not so easy ... Anyway, I tried to place your example and mine in the same page using PHP, which I am really not very familiar: http://www.27lamps.com/Labs/AutoComplete/AutoComplete.html Sorry, but I am not really use with PHP. Thanks, Miguel On Jul 13, 2:41 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You still haven't posted a testpage. It doesn't have to be dynamic, a static file that delivers the content that your serverside usually works just as well. Jörn On Sun, Jul 13, 2008 at 2:45 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 12, 6:46 pm, shapper [EMAIL PROTECTED] wrote: Hi, I can upload the client part but I am generating my JSON using ASP.NET MVC and the project is not finish so I can't upload it because it uses a SQL server. Don't you have any idea what is going on? I set up a page with this and I will try to explain what I get. When I use: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, selectFirst: false }); My autocomplete shows but only one option in the list ... however that option is including all the options returned by the Json according to that criteria. For example, if I type M I get one option which when selected puts the following in the input: [{TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]}] You see? It picks the two options. I tried again and typed F and I get: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}] Which is also right because I have only that record. So the server code is receiving well the parameter and returning the filtered records it but somehow the autocomplete interprets that as only one record and does not display it the right way ... I am using JSonResult of ASP.NET MVC to return the JSON and it seems to be ok. Any idea? Thanks, Miguel On Jul 12, 5:23 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please upload a testpage and provide a link. There are too many things that can go wrong here. Jörn On Sat, Jul 12, 2008 at 3:32 PM, shapper [EMAIL PROTECTED] wrote: Hi, I tried to make this work following your example but until now I wasn't able to make this work? Could you, please, help me out? This is what I have at the moment: $(#Tags).autocomplete(/File/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); My JSon data is as follows: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] What am I doing wrong? I have been trying many variations of my code but it still does not work. Thanks, Miguel On Jul 12, 12:05 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Remote json is still rather cumbersome to handle. Here is an example, take a look at the source:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html Jörn On Sat, Jul 12, 2008 at 1:01 AM, shapper [EMAIL PROTECTED] wrote: I also tried the following but until now I wasn't able to make it work: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, formatResult: function(item) { return item.Name; } }); Please, does anyone knows how to do this? MyJson data is as follows: [{TagID:3fae2160-55f6-4dd0-b856-fd27f5d307e2,Name:John}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Jane}] I have been trying to solve this but until now I wasn't able ... Thanks, Miguel On Jul 11, 8:53 pm, shapper [EMAIL PROTECTED] wrote: Yes, I tried the following: $(#Tags).autocomplete(/File/GetTags, { width: 260, formatItem: function(item) { return item.Name; } }); But this is not working. Any idea? Thanks, Miguel On Jul 11, 7:03 pm, tlphipps [EMAIL PROTECTED] wrote: You need to use the formatResult option (I think that's the option name). It will allow you to format the data for display. On Jul 11, 12
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Hi, I tried to replicate your code using the JSon string generated by ASP.NET MVC. I created a static php code as you did ... To be honest I am not familiar with php. This was the best I was able to do ... I have been trying everything to make this work ... I really don't understand why my AutoComplete does not work ... Here is the page I created: http://www.27lamps.com/Labs/AutoComplete/demo/tags.html I cannot guarantee that PHP code is ok ... I am really not used to it. My ASP.NET MVC application generates the following JSon string: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}, {TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61-b03a- e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}] This was what I tried to replicate. Does anyone has any idea how to solve my problem? Thanks, Miguel On Jul 13, 9:44 pm, shapper [EMAIL PROTECTED] wrote: Hi, With ASP.NET this is not so easy ... Anyway, I tried to place your example and mine in the same page using PHP, which I am really not very familiar:http://www.27lamps.com/Labs/AutoComplete/AutoComplete.html Sorry, but I am not really use with PHP. Thanks, Miguel On Jul 13, 2:41 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You still haven't posted a testpage. It doesn't have to be dynamic, a static file that delivers the content that your serverside usually works just as well. Jörn On Sun, Jul 13, 2008 at 2:45 PM, shapper [EMAIL PROTECTED] wrote: Please, anyone? On Jul 12, 6:46 pm, shapper [EMAIL PROTECTED] wrote: Hi, I can upload the client part but I am generating my JSON using ASP.NET MVC and the project is not finish so I can't upload it because it uses a SQL server. Don't you have any idea what is going on? I set up a page with this and I will try to explain what I get. When I use: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, selectFirst: false }); My autocomplete shows but only one option in the list ... however that option is including all the options returned by the Json according to that criteria. For example, if I type M I get one option which when selected puts the following in the input: [{TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]}] You see? It picks the two options. I tried again and typed F and I get: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}] Which is also right because I have only that record. So the server code is receiving well the parameter and returning the filtered records it but somehow the autocomplete interprets that as only one record and does not display it the right way ... I am using JSonResult of ASP.NET MVC to return the JSON and it seems to be ok. Any idea? Thanks, Miguel On Jul 12, 5:23 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please upload a testpage and provide a link. There are too many things that can go wrong here. Jörn On Sat, Jul 12, 2008 at 3:32 PM, shapper [EMAIL PROTECTED] wrote: Hi, I tried to make this work following your example but until now I wasn't able to make this work? Could you, please, help me out? This is what I have at the moment: $(#Tags).autocomplete(/File/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); My JSon data is as follows: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] What am I doing wrong? I have been trying many variations of my code but it still does not work. Thanks, Miguel On Jul 12, 12:05 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Remote json is still rather cumbersome to handle. Here is an example, take a look at the source:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html Jörn On Sat, Jul 12, 2008 at 1:01 AM, shapper [EMAIL PROTECTED] wrote: I also tried the following but until now I wasn't able to make it work: $(#Tags).autocomplete(/Professor
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Hi, I tried to make this work following your example but until now I wasn't able to make this work? Could you, please, help me out? This is what I have at the moment: $(#Tags).autocomplete(/File/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); My JSon data is as follows: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] What am I doing wrong? I have been trying many variations of my code but it still does not work. Thanks, Miguel On Jul 12, 12:05 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Remote json is still rather cumbersome to handle. Here is an example, take a look at the source:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html Jörn On Sat, Jul 12, 2008 at 1:01 AM, shapper [EMAIL PROTECTED] wrote: I also tried the following but until now I wasn't able to make it work: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, formatResult: function(item) { return item.Name; } }); Please, does anyone knows how to do this? MyJson data is as follows: [{TagID:3fae2160-55f6-4dd0-b856-fd27f5d307e2,Name:John}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Jane}] I have been trying to solve this but until now I wasn't able ... Thanks, Miguel On Jul 11, 8:53 pm, shapper [EMAIL PROTECTED] wrote: Yes, I tried the following: $(#Tags).autocomplete(/File/GetTags, { width: 260, formatItem: function(item) { return item.Name; } }); But this is not working. Any idea? Thanks, Miguel On Jul 11, 7:03 pm, tlphipps [EMAIL PROTECTED] wrote: You need to use the formatResult option (I think that's the option name). It will allow you to format the data for display. On Jul 11, 12:08 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using JQuery AutoComplete with JSon. I created a function on my server code which return the data. However, when I start writing J in my Input I get the following: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] How to get only the names instead of this strange format? Am I a missing something here? Thanks, Miguel
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Hi, I can upload the client part but I am generating my JSON using ASP.NET MVC and the project is not finish so I can't upload it because it uses a SQL server. Don't you have any idea what is going on? I set up a page with this and I will try to explain what I get. When I use: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, selectFirst: false }); My autocomplete shows but only one option in the list ... however that option is including all the options returned by the Json according to that criteria. For example, if I type M I get one option which when selected puts the following in the input: [{TagID:3fae2160-55f6-4dd0-b856- fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática B,FileTags:[],ProfessorTags:[]}] You see? It picks the two options. I tried again and typed F and I get: [{TagID:017b253e-596b-4328-85f5- fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]}] Which is also right because I have only that record. So the server code is receiving well the parameter and returning the filtered records it but somehow the autocomplete interprets that as only one record and does not display it the right way ... I am using JSonResult of ASP.NET MVC to return the JSON and it seems to be ok. Any idea? Thanks, Miguel On Jul 12, 5:23 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Please upload a testpage and provide a link. There are too many things that can go wrong here. Jörn On Sat, Jul 12, 2008 at 3:32 PM, shapper [EMAIL PROTECTED] wrote: Hi, I tried to make this work following your example but until now I wasn't able to make this work? Could you, please, help me out? This is what I have at the moment: $(#Tags).autocomplete(/File/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, parse: function(data) { return $.map(eval(data), function(row) { return { data: row, value: row.Name, result: row.Name } }); }, formatItem: function(item) { return item; } }); My JSon data is as follows: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] What am I doing wrong? I have been trying many variations of my code but it still does not work. Thanks, Miguel On Jul 12, 12:05 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Remote json is still rather cumbersome to handle. Here is an example, take a look at the source:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html Jörn On Sat, Jul 12, 2008 at 1:01 AM, shapper [EMAIL PROTECTED] wrote: I also tried the following but until now I wasn't able to make it work: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, formatResult: function(item) { return item.Name; } }); Please, does anyone knows how to do this? MyJson data is as follows: [{TagID:3fae2160-55f6-4dd0-b856-fd27f5d307e2,Name:John}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Jane}] I have been trying to solve this but until now I wasn't able ... Thanks, Miguel On Jul 11, 8:53 pm, shapper [EMAIL PROTECTED] wrote: Yes, I tried the following: $(#Tags).autocomplete(/File/GetTags, { width: 260, formatItem: function(item) { return item.Name; } }); But this is not working. Any idea? Thanks, Miguel On Jul 11, 7:03 pm, tlphipps [EMAIL PROTECTED] wrote: You need to use the formatResult option (I think that's the option name). It will allow you to format the data for display. On Jul 11, 12:08 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using JQuery AutoComplete with JSon. I created a function on my server code which return the data. However, when I start writing J in my Input I get the following: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] How to get only the names instead of this strange format? Am I a missing something here? Thanks, Miguel
[jQuery] Button Click
Hello, I have a button which redirects to a page: button class=Cancel type=button onclick=location.href='/Tag/ List?page=1' id=CancelCancel/button Should I remove the onclick from the button and do this with JQuery? And how can I do that using JQuery? Thanks, Miguel
[jQuery] Re: Button Click
No no, I already use Jquery for many things like: form validation, autocomplete, etc ... In this page I use only that and the only Javascript I have in my HTML markup is this one in this button ... this is why i am asking this. Thanks, Miguel On Jul 11, 5:50 pm, noon [EMAIL PROTECTED] wrote: Should you? Well if thats the only javascript on the page there isn't much point in including a library for something like that. However you could do it by saying: // jQuery's document ready $(function() { // grab the button and assign event $(#Cancel).click(function() { window.location.href = /some/url/here; }); }); On Jul 11, 12:39 pm, shapper [EMAIL PROTECTED] wrote: Hello, I have a button which redirects to a page: button class=Cancel type=button onclick=location.href='/Tag/ List?page=1' id=CancelCancel/button Should I remove the onclick from the button and do this with JQuery? And how can I do that using JQuery? Thanks, Miguel
[jQuery] AutoComplete and JSon not working as expected. Please, help me out.
Hello, I am using JQuery AutoComplete with JSon. I created a function on my server code which return the data. However, when I start writing J in my Input I get the following: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] How to get only the names instead of this strange format? Am I a missing something here? Thanks, Miguel
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
Yes, I tried the following: $(#Tags).autocomplete(/File/GetTags, { width: 260, formatItem: function(item) { return item.Name; } }); But this is not working. Any idea? Thanks, Miguel On Jul 11, 7:03 pm, tlphipps [EMAIL PROTECTED] wrote: You need to use the formatResult option (I think that's the option name). It will allow you to format the data for display. On Jul 11, 12:08 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using JQuery AutoComplete with JSon. I created a function on my server code which return the data. However, when I start writing J in my Input I get the following: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] How to get only the names instead of this strange format? Am I a missing something here? Thanks, Miguel
[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.
I also tried the following but until now I wasn't able to make it work: $(#Tags).autocomplete(/Professor/GetTags, { autoFill: true, cacheLength: 1, multiple: true, scrollHeight: 200, selectFirst: false, width: 260, formatResult: function(item) { return item.Name; } }); Please, does anyone knows how to do this? MyJson data is as follows: [{TagID:3fae2160-55f6-4dd0-b856-fd27f5d307e2,Name:John}, {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Jane}] I have been trying to solve this but until now I wasn't able ... Thanks, Miguel On Jul 11, 8:53 pm, shapper [EMAIL PROTECTED] wrote: Yes, I tried the following: $(#Tags).autocomplete(/File/GetTags, { width: 260, formatItem: function(item) { return item.Name; } }); But this is not working. Any idea? Thanks, Miguel On Jul 11, 7:03 pm, tlphipps [EMAIL PROTECTED] wrote: You need to use the formatResult option (I think that's the option name). It will allow you to format the data for display. On Jul 11, 12:08 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using JQuery AutoComplete with JSon. I created a function on my server code which return the data. However, when I start writing J in my Input I get the following: [{TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:John}, {TagID:017b253e-596b-4328-85f5-fd97a783759c,Name:Jane}] How to get only the names instead of this strange format? Am I a missing something here? Thanks, Miguel
[jQuery] Re: AutoComplete and Validation
I am using ASP.NET MVC ... So the autocomplete list is defined on the server and accessed on HTML using something like: %= MyModel.ViewData.TagList.ToString % Can I use something like this to define the validation? Thanks, Miguel On Jun 27, 1:59 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Depending on where your autocomplete data is coming from, you could use a custom method (local data) or the remote method (remote data). http://docs.jquery.com/Plugins/Validation/Validator/addMethodhttp://docs.jquery.com/Plugins/Validation/Methods/remote Jörn On Fri, Jun 27, 2008 at 2:42 AM, shapper [EMAIL PROTECTED] wrote: Hello, I am using AutoComplete with Validation. Can I create a validation that accepts only values from the autocomplete? For example if the autocomplete list is: New York, London, Lisbon, Paris Then the following would be accepted: New York, London New York Lisbon, Paris London,Paris,Lisbon But not: New York, Rome Moscow Is this possible? Thanks, Miguel
[jQuery] Re: Validation Plugin issue when using TinyMCE
Please, does anyone knows why do I need to push twice the submit button so the validation be updated? Thanks, Miguel On Jun 25, 2:01 pm, shapper [EMAIL PROTECTED] wrote: Hi, It worked but now I get a new problem which I also notice before! I though it was due to this but it seems it is not ... The validator only takes effect when I click the submit button twice! For example, if i place some text in the first TinyMCE text area and nothing on the second and click the submit button I get an error message on both text areas, If i click it again then the error message of the first text area disappears. And this happens in all situations. Any idea? Is this a Validation Plugin Bug? Thanks, Miguel On Jun 25, 12:33 am, Josh Nathanson [EMAIL PROTECTED] wrote: I think maybe you want element.is(textarea) (no colon) Otherwise that part of the conditional will never fire. -- Josh - Original Message - From: shapper [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Tuesday, June 24, 2008 4:23 PM Subject: [jQuery] Re: [validate] Validation Plugin issue when using TinyMCE You mean the { after the else? Yes, I noticed that before. I keep having the same problem. The form is not validated when I use errorPlacement. I am using: $(#New).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else error.insertAfter(element); }, rules: { Answer: {required: true}, Question: {required: true} }, messages: { Answer: {required: Insert an answer}, Question: {required: Insert a question} } }); Any idea? Thanks, Miguel On Jun 24, 11:18 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: There was a syntax error in the errorPlacement, try this: errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else error.insertAfter(element); }, On Tue, Jun 24, 2008 at 11:36 PM, shapper [EMAIL PROTECTED] wrote: Hello, I have been trying to make JQuery Validation with TinyMCE and until now I wasn't able to do this. I have 2 text areas converted to TinyMCE. I am using: $(#New).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); }, rules: { Answer: {required: true}, Question: {required: true} }, messages: { Answer: {required: Insert an answer}, Question: {required: Insert a question} } }); Using this code does not even validate. The form is submited. If I remove the errorReplacement part then it works but the error message is out of place. I tried many options but until now I wasn't able to make this work. Any idea how to solve this? Thanks, Miguel On Jun 24, 3:01 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: How about this: errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); } Jörn On Tue, Jun 24, 2008 at 2:18 PM, shapper [EMAIL PROTECTED] wrote: Hello, I checked the markup used by TinyMCE and it is something as follows: label for=QuestionQuestion/label textarea id=Question cols=20 rows=10 name=Question style=display: none;/ span id=Question_parent class=mceEditor BonsAlunosSkin table id=Question_tbl class=mceLayout cellspacing=0 cellpadding=0 style=width: 538px; height: 175px; tbody . /tbody /table /span So the textarea is disabled and replaced by a span and table ... I then changed my validation code to: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Question: {required: true}}, errorPlacement: function(error, element) { if (element.is(:textarea)) error.appendTo(element.parent().next().next('textarea')); } }); This is not working. Could you, please, tell me what am I doing wrong? I also tried with table but no success. On Jun 23, 9:57 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Most likely TinyMCE creates a new element and places it after the textarea, hiding the former. Use the errorPlacement-option to customize the placement for that case. Jörn On Mon, Jun 23, 2008 at 1:54 AM, shapper [EMAIL PROTECTED] wrote: Hello, I have the following rules: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Answer: {required: true}}, }); Applied to text area: label
[jQuery] AutoComplete and Validation
Hello, I am using AutoComplete with Validation. Can I create a validation that accepts only values from the autocomplete? For example if the autocomplete list is: New York, London, Lisbon, Paris Then the following would be accepted: New York, London New York Lisbon,Paris London,Paris,Lisbon But not: New York, Rome Moscow Is this possible? Thanks, Miguel
[jQuery] Re: [validate] Validation Plugin issue when using TinyMCE
Hi, It worked but now I get a new problem which I also notice before! I though it was due to this but it seems it is not ... The validator only takes effect when I click the submit button twice! For example, if i place some text in the first TinyMCE text area and nothing on the second and click the submit button I get an error message on both text areas, If i click it again then the error message of the first text area disappears. And this happens in all situations. Any idea? Is this a Validation Plugin Bug? Thanks, Miguel On Jun 25, 12:33 am, Josh Nathanson [EMAIL PROTECTED] wrote: I think maybe you want element.is(textarea) (no colon) Otherwise that part of the conditional will never fire. -- Josh - Original Message - From: shapper [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Tuesday, June 24, 2008 4:23 PM Subject: [jQuery] Re: [validate] Validation Plugin issue when using TinyMCE You mean the { after the else? Yes, I noticed that before. I keep having the same problem. The form is not validated when I use errorPlacement. I am using: $(#New).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else error.insertAfter(element); }, rules: { Answer: {required: true}, Question: {required: true} }, messages: { Answer: {required: Insert an answer}, Question: {required: Insert a question} } }); Any idea? Thanks, Miguel On Jun 24, 11:18 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: There was a syntax error in the errorPlacement, try this: errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else error.insertAfter(element); }, On Tue, Jun 24, 2008 at 11:36 PM, shapper [EMAIL PROTECTED] wrote: Hello, I have been trying to make JQuery Validation with TinyMCE and until now I wasn't able to do this. I have 2 text areas converted to TinyMCE. I am using: $(#New).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); }, rules: { Answer: {required: true}, Question: {required: true} }, messages: { Answer: {required: Insert an answer}, Question: {required: Insert a question} } }); Using this code does not even validate. The form is submited. If I remove the errorReplacement part then it works but the error message is out of place. I tried many options but until now I wasn't able to make this work. Any idea how to solve this? Thanks, Miguel On Jun 24, 3:01 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: How about this: errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); } Jörn On Tue, Jun 24, 2008 at 2:18 PM, shapper [EMAIL PROTECTED] wrote: Hello, I checked the markup used by TinyMCE and it is something as follows: label for=QuestionQuestion/label textarea id=Question cols=20 rows=10 name=Question style=display: none;/ span id=Question_parent class=mceEditor BonsAlunosSkin table id=Question_tbl class=mceLayout cellspacing=0 cellpadding=0 style=width: 538px; height: 175px; tbody . /tbody /table /span So the textarea is disabled and replaced by a span and table ... I then changed my validation code to: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Question: {required: true}}, errorPlacement: function(error, element) { if (element.is(:textarea)) error.appendTo(element.parent().next().next('textarea')); } }); This is not working. Could you, please, tell me what am I doing wrong? I also tried with table but no success. On Jun 23, 9:57 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Most likely TinyMCE creates a new element and places it after the textarea, hiding the former. Use the errorPlacement-option to customize the placement for that case. Jörn On Mon, Jun 23, 2008 at 1:54 AM, shapper [EMAIL PROTECTED] wrote: Hello, I have the following rules: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Answer: {required: true}}, }); Applied to text area: label for=Answer class=RequiredResposta/label textarea name=Answer rows=10 cols=20 id=Answer/ textarea This works fine. The error labels shows after the TextArea. The moment I use TinyMCE (http://tinymce.moxiecode.com/) to make the Text Area an HTML WYSIWYG editor I get a problem
[jQuery] Re: [validate] Validation Plugin issue when using TinyMCE
Hello, I checked the markup used by TinyMCE and it is something as follows: label for=QuestionQuestion/label textarea id=Question cols=20 rows=10 name=Question style=display: none;/ span id=Question_parent class=mceEditor BonsAlunosSkin table id=Question_tbl class=mceLayout cellspacing=0 cellpadding=0 style=width: 538px; height: 175px; tbody . /tbody /table /span So the textarea is disabled and replaced by a span and table ... I then changed my validation code to: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Question: {required: true}}, errorPlacement: function(error, element) { if (element.is(:textarea)) error.appendTo(element.parent().next().next('textarea')); } }); This is not working. Could you, please, tell me what am I doing wrong? I also tried with table but no success. On Jun 23, 9:57 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Most likely TinyMCE creates a new element and places it after the textarea, hiding the former. Use the errorPlacement-option to customize the placement for that case. Jörn On Mon, Jun 23, 2008 at 1:54 AM, shapper [EMAIL PROTECTED] wrote: Hello, I have the following rules: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Answer: {required: true}}, }); Applied to text area: label for=Answer class=RequiredResposta/label textarea name=Answer rows=10 cols=20 id=Answer/ textarea This works fine. The error labels shows after the TextArea. The moment I use TinyMCE (http://tinymce.moxiecode.com/) to make the Text Area an HTML WYSIWYG editor I get a problem: The error label shows before the text area and after the label! Any idea what might be wrong? How can I solve this? Thanks, Miguel
[jQuery] Re: [validate] Validation Plugin issue when using TinyMCE
Hello, I have been trying to make JQuery Validation with TinyMCE and until now I wasn't able to do this. I have 2 text areas converted to TinyMCE. I am using: $(#New).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); }, rules: { Answer: {required: true}, Question: {required: true} }, messages: { Answer: {required: Insert an answer}, Question: {required: Insert a question} } }); Using this code does not even validate. The form is submited. If I remove the errorReplacement part then it works but the error message is out of place. I tried many options but until now I wasn't able to make this work. Any idea how to solve this? Thanks, Miguel On Jun 24, 3:01 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: How about this: errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); } Jörn On Tue, Jun 24, 2008 at 2:18 PM, shapper [EMAIL PROTECTED] wrote: Hello, I checked the markup used by TinyMCE and it is something as follows: label for=QuestionQuestion/label textarea id=Question cols=20 rows=10 name=Question style=display: none;/ span id=Question_parent class=mceEditor BonsAlunosSkin table id=Question_tbl class=mceLayout cellspacing=0 cellpadding=0 style=width: 538px; height: 175px; tbody . /tbody /table /span So the textarea is disabled and replaced by a span and table ... I then changed my validation code to: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Question: {required: true}}, errorPlacement: function(error, element) { if (element.is(:textarea)) error.appendTo(element.parent().next().next('textarea')); } }); This is not working. Could you, please, tell me what am I doing wrong? I also tried with table but no success. On Jun 23, 9:57 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Most likely TinyMCE creates a new element and places it after the textarea, hiding the former. Use the errorPlacement-option to customize the placement for that case. Jörn On Mon, Jun 23, 2008 at 1:54 AM, shapper [EMAIL PROTECTED] wrote: Hello, I have the following rules: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Answer: {required: true}}, }); Applied to text area: label for=Answer class=RequiredResposta/label textarea name=Answer rows=10 cols=20 id=Answer/ textarea This works fine. The error labels shows after the TextArea. The moment I use TinyMCE (http://tinymce.moxiecode.com/) to make the Text Area an HTML WYSIWYG editor I get a problem: The error label shows before the text area and after the label! Any idea what might be wrong? How can I solve this? Thanks, Miguel
[jQuery] Re: [validate] Validation Plugin issue when using TinyMCE
You mean the { after the else? Yes, I noticed that before. I keep having the same problem. The form is not validated when I use errorPlacement. I am using: $(#New).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else error.insertAfter(element); }, rules: { Answer: {required: true}, Question: {required: true} }, messages: { Answer: {required: Insert an answer}, Question: {required: Insert a question} } }); Any idea? Thanks, Miguel On Jun 24, 11:18 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: There was a syntax error in the errorPlacement, try this: errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else error.insertAfter(element); }, On Tue, Jun 24, 2008 at 11:36 PM, shapper [EMAIL PROTECTED] wrote: Hello, I have been trying to make JQuery Validation with TinyMCE and until now I wasn't able to do this. I have 2 text areas converted to TinyMCE. I am using: $(#New).validate({ errorClass: Error, errorElement: label, errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); }, rules: { Answer: {required: true}, Question: {required: true} }, messages: { Answer: {required: Insert an answer}, Question: {required: Insert a question} } }); Using this code does not even validate. The form is submited. If I remove the errorReplacement part then it works but the error message is out of place. I tried many options but until now I wasn't able to make this work. Any idea how to solve this? Thanks, Miguel On Jun 24, 3:01 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: How about this: errorPlacement: function(error, element) { if (element.is(:textarea)) error.insertAfter(element.next()); else { error.insertAfter(element); } Jörn On Tue, Jun 24, 2008 at 2:18 PM, shapper [EMAIL PROTECTED] wrote: Hello, I checked the markup used by TinyMCE and it is something as follows: label for=QuestionQuestion/label textarea id=Question cols=20 rows=10 name=Question style=display: none;/ span id=Question_parent class=mceEditor BonsAlunosSkin table id=Question_tbl class=mceLayout cellspacing=0 cellpadding=0 style=width: 538px; height: 175px; tbody . /tbody /table /span So the textarea is disabled and replaced by a span and table ... I then changed my validation code to: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Question: {required: true}}, errorPlacement: function(error, element) { if (element.is(:textarea)) error.appendTo(element.parent().next().next('textarea')); } }); This is not working. Could you, please, tell me what am I doing wrong? I also tried with table but no success. On Jun 23, 9:57 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Most likely TinyMCE creates a new element and places it after the textarea, hiding the former. Use the errorPlacement-option to customize the placement for that case. Jörn On Mon, Jun 23, 2008 at 1:54 AM, shapper [EMAIL PROTECTED] wrote: Hello, I have the following rules: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Answer: {required: true}}, }); Applied to text area: label for=Answer class=RequiredResposta/label textarea name=Answer rows=10 cols=20 id=Answer/ textarea This works fine. The error labels shows after the TextArea. The moment I use TinyMCE (http://tinymce.moxiecode.com/) to make the Text Area an HTML WYSIWYG editor I get a problem: The error label shows before the text area and after the label! Any idea what might be wrong? How can I solve this? Thanks, Miguel
[jQuery] [validate] Validation Cancel Button
Hello, I know that is possible to use a button with class cancel to be able to cancel and not validate. But can I define another class? Thanks, Miguel
[jQuery] [validate] Validation Minimized Script
Hello, How is the Minimized version of the validation script file created? What tool is used? Thanks, Miguel
[jQuery] Re: [validate] Validation Cancel Button
Jorn, In all my posts I add [validate] on the subject but it never shows. Do you know why? Thanks, Miguel On Jun 23, 12:26 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: No, currently cancel is hardcoded. Jörn On Mon, Jun 23, 2008 at 12:45 AM, shapper [EMAIL PROTECTED] wrote: Hello, I know that is possible to use a button with class cancel to be able to cancel and not validate. But can I define another class? Thanks, Miguel
[jQuery] [validate] Validation Plugin issue when using TinyMCE
Hello, I have the following rules: $(#New).validate({ errorClass: Error, errorElement: label, rules: {Answer: {required: true}}, }); Applied to text area: label for=Answer class=RequiredResposta/label textarea name=Answer rows=10 cols=20 id=Answer/ textarea This works fine. The error labels shows after the TextArea. The moment I use TinyMCE (http://tinymce.moxiecode.com/) to make the Text Area an HTML WYSIWYG editor I get a problem: The error label shows before the text area and after the label! Any idea what might be wrong? How can I solve this? Thanks, Miguel
[jQuery] [validate] Validation is not working as expected. Input value deleted!
Hello, I am trying to validate and mask a text box that should contain a DateTime in the following format: -mm-dd hh:mm:ss The validation is not working as expected. The problem is: In a presence of a valid data I deleted a small part of it (ss). The mask is revealed for this part. If after deleting a part of the date/time I change the focus to another input or submit the form I get: 1. A message saying the date/time is invalid (This is expected) 2. The entire content of the input disappears. (This is not suppose to happen!) Every time I insert a invalid date I get a message but the date/time inserted is deleted. What is going on? I am testing the date/time in 2 ways: Required and through a method that uses Regex: // Form validation $(#Edit).validate({ rules: { UpdatedAt: { required: true, sqldatetime: true } }, messages: { UpdatedAt: { required: Insert Date/Time, sqldatetime: Check the date/time. Use the format -mm- dd hh:mm:ss } } }); And the method sqldatetime is: $.validator.addMethod('sqldatetime', function (value) { return /^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2] [0-3]):([0-5][0-9]):([0-5][0-9])|)$/.test(value); }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss'); The Regex validates only non empty values. If the value is empty it is also valid. I have made this so that my method does not conflict with Required and allow to have the two options only by adding or not the required rule. I tried to find the problem but wasn't able to. Any idea what is going wrong? Thanks, Miguel
[jQuery] Re: [validate] Validation is not working as expected. Input value deleted!
You mean using the following: $.validator.addMethod('sqldatetime', function (value, element) { return this.optional(element) || /^(([0-9]{4})-([0-1][0-9])-([0-3] [0-9])\s([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])|) $/.test(value); }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss'); Still does not work On Jun 20, 2:44 pm, Alexsandro_xpt [EMAIL PROTECTED] wrote: Hi shapper, do you speak portugues? Please contact me for Validate chat through by e-mail. Thz. On 20 jun, 07:53, shapper [EMAIL PROTECTED] wrote: Hello, I am trying to validate and mask a text box that should contain a DateTime in the following format: -mm-dd hh:mm:ss The validation is not working as expected. The problem is: In a presence of a valid data I deleted a small part of it (ss). The mask is revealed for this part. If after deleting a part of the date/time I change the focus to another input or submit the form I get: 1. A message saying the date/time is invalid (This is expected) 2. The entire content of the input disappears. (This is not suppose to happen!) Every time I insert a invalid date I get a message but the date/time inserted is deleted. What is going on? I am testing the date/time in 2 ways: Required and through a method that uses Regex: // Form validation $(#Edit).validate({ rules: { UpdatedAt: { required: true, sqldatetime: true } }, messages: { UpdatedAt: { required: Insert Date/Time, sqldatetime: Check the date/time. Use the format -mm- dd hh:mm:ss } } }); And the method sqldatetime is: $.validator.addMethod('sqldatetime', function (value) { return /^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2] [0-3]):([0-5][0-9]):([0-5][0-9])|)$/.test(value); }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss'); The Regex validates only non empty values. If the value is empty it is also valid. I have made this so that my method does not conflict with Required and allow to have the two options only by adding or not the required rule. I tried to find the problem but wasn't able to. Any idea what is going wrong? Thanks, Miguel
[jQuery] Re: Validation is not working as expected. Input value deleted!
Very strange ... it works both ways ... well, what I mean is that I keep having the same problem in both cases. Any more ideas? Did anyone notice that the Validation Examples Forms that have Masking don't work in Firefox 3? Thanks, Miguel On Jun 20, 7:46 pm, Brian J. Fink [EMAIL PROTECTED] wrote: @Miguel: It appears you have the RegExp value and the value switched. Maybe you meant: $.validator.addMethod('sqldatetime', function (value) { return value.test(/^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1] [0-9]|[2] [0-3]):([0-5][0-9]):([0-5][0-9])|)$/); }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss'); On Jun 20, 6:53 am, shapper [EMAIL PROTECTED] wrote: Hello, I am trying to validate and mask a text box that should contain a DateTime in the following format: -mm-dd hh:mm:ss The validation is not working as expected. The problem is: In a presence of a valid data I deleted a small part of it (ss). The mask is revealed for this part. If after deleting a part of the date/time I change the focus to another input or submit the form I get: 1. A message saying the date/time is invalid (This is expected) 2. The entire content of the input disappears. (This is not suppose to happen!) Every time I insert a invalid date I get a message but the date/time inserted is deleted. What is going on? I am testing the date/time in 2 ways: Required and through a method that uses Regex: // Form validation $(#Edit).validate({ rules: { UpdatedAt: { required: true, sqldatetime: true } }, messages: { UpdatedAt: { required: Insert Date/Time, sqldatetime: Check the date/time. Use the format -mm- dd hh:mm:ss } } }); And the method sqldatetime is: $.validator.addMethod('sqldatetime', function (value) { return /^(([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2] [0-3]):([0-5][0-9]):([0-5][0-9])|)$/.test(value); }, 'Verifique a data e hora. Use o formato -mm-dd hh:mm:ss'); The Regex validates only non empty values. If the value is empty it is also valid. I have made this so that my method does not conflict with Required and allow to have the two options only by adding or not the required rule. I tried to find the problem but wasn't able to. Any idea what is going wrong? Thanks, Miguel
[jQuery] Can't post in this forum
Hello, Most of my posts in this forum are not published. Why? Thanks, Miguel
[jQuery] Re: Validation + Mask + Regex. Please, help me out. Thank You.
Please, anyone? Thank You, Miguel On Jun 18, 11:18 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using masking and client validation in a form using: Validator Plugin -http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Masked Input Plugin -http://digitalbush.com/projects/masked-input-plugin In an input I have a Date Time in the following format: -mm-dd hh:mm:ss I am adding the masking as follows: jQuery(function($){ $(#UpdatedAt).mask(-99-99 99:99:99); }); How can I validate my field integrating it with the mask and using a Regex to be sure that the date time is valid? I already have the Regex Expression: ^([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2][0-3]):([0-5] [0-9]):([0-5][0-9])$ The date and time are also required. I already have the following: // Form validation $(#Edit).validate({ errorClass: Error, errorElement: label, rules: { UpdatedAt: {required: true} }, messages: { UpdatedAt: { required: Insert Updated date and time }, }, }); Could someone please help me? I have been trying all day but until now I wasn't able to make this work. Thanks, Miguel
[jQuery] Re: Validation + Mask + Regex. Please, help me out. Thank You.
Hi, I just solved it using: $.validator.addMethod('sqldatetime', function (value) { return /^([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2][0-3]): ([0-5][0-9]):([0-5][0-9])$/.test(value); }, 'Check your date and time. Use the format -mm-dd hh:mm:ss'); I am not sure if this is the way to integrate with Mask but it is working. Thanks, Miguel On Jun 19, 1:36 pm, shapper [EMAIL PROTECTED] wrote: Please, anyone? Thank You, Miguel On Jun 18, 11:18 pm, shapper [EMAIL PROTECTED] wrote: Hello, I am using masking and client validation in a form using: Validator Plugin -http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Masked Input Plugin -http://digitalbush.com/projects/masked-input-plugin In an input I have a Date Time in the following format: -mm-dd hh:mm:ss I am adding the masking as follows: jQuery(function($){ $(#UpdatedAt).mask(-99-99 99:99:99); }); How can I validate my field integrating it with the mask and using a Regex to be sure that the date time is valid? I already have the Regex Expression: ^([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2][0-3]):([0-5] [0-9]):([0-5][0-9])$ The date and time are also required. I already have the following: // Form validation $(#Edit).validate({ errorClass: Error, errorElement: label, rules: { UpdatedAt: {required: true} }, messages: { UpdatedAt: { required: Insert Updated date and time }, }, }); Could someone please help me? I have been trying all day but until now I wasn't able to make this work. Thanks, Miguel
[jQuery] Re: [validate] How to integrate validation with masking?
Hi, I know those examples and I kind of solved it using: $.validator.addMethod('sqldatetime', function (value) { return /^([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2] [0-3]): ([0-5][0-9]):([0-5][0-9])$/.test(value); }, 'Check your date and time. Use the format -mm-dd hh:mm:ss'); However I am not sure if this is full integrated. I mean this does not give me the option to access empty fields ... Of course I can change my Regular Expression or add an if to the method to validate only if the value is not empty ... Anyway, Is this the way to integrate Validate and Mask? I checked the code on the examples but I am not sure if I am doing this the right way. Thanks, Miguel On Jun 19, 4:27 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Here is an example using both plugins:http://dev.jquery.com/view/trunk/plugins/validate/demo/marketo/ The second step changes the creditcard mask based on another field:http://dev.jquery.com/view/trunk/plugins/validate/demo/marketo/step2.htm Jörn On Wed, Jun 18, 2008 at 7:11 PM, shapper [EMAIL PROTECTED] wrote: Hello, I am validating a form but one of the fields has a mask: 99-99- 99:99:99 This is: Day-Month-Year Hour:Minutes:Seconds How can I integrate my validation with my mask? I am using: http://digitalbush.com/projects/masked-input-plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ I am not sure if these are the right plugins for this ... at least this is what I have been using. Could someone, please, help me out? Thanks, Miguel Here is my code: // Form mask jQuery(function($){ $(#UpdatedAt).mask(99-99- 99:99:99); }); // Form validation $(#Edit).validate({ errorClass: Error, errorElement: label, rules: { Name: {required: true}, UpdatedAt: {required: true} }, messages: { Name: {required: What is your name?}, UpdatedAt: { required: Insert the updated date and time }, }, });
[jQuery] Re: [validate] How to integrate validation with masking?
Hi, I know those examples and I kind of solved it using: $.validator.addMethod('sqldatetime', function (value) { return /^([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2] [0-3]): ([0-5][0-9]):([0-5][0-9])$/.test(value); }, 'Check your date and time. Use the format -mm-dd hh:mm:ss'); However I am not sure if this is full integrated. I mean this does not give me the option to access empty fields ... Of course I can change my Regular Expression or add an if to the method to validate only if the value is not empty ... Anyway, Is this the way to integrate Validate and Mask? I checked the code on the examples but I am not sure if I am doing this the right way. Thanks, Miguel On Jun 19, 4:27 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: Here is an example using both plugins:http://dev.jquery.com/view/trunk/plugins/validate/demo/marketo/ The second step changes the creditcard mask based on another field:http://dev.jquery.com/view/trunk/plugins/validate/demo/marketo/step2.htm Jörn On Wed, Jun 18, 2008 at 7:11 PM, shapper [EMAIL PROTECTED] wrote: Hello, I am validating a form but one of the fields has a mask: 99-99- 99:99:99 This is: Day-Month-Year Hour:Minutes:Seconds How can I integrate my validation with my mask? I am using: http://digitalbush.com/projects/masked-input-plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ I am not sure if these are the right plugins for this ... at least this is what I have been using. Could someone, please, help me out? Thanks, Miguel Here is my code: // Form mask jQuery(function($){ $(#UpdatedAt).mask(99-99- 99:99:99); }); // Form validation $(#Edit).validate({ errorClass: Error, errorElement: label, rules: { Name: {required: true}, UpdatedAt: {required: true} }, messages: { Name: {required: What is your name?}, UpdatedAt: { required: Insert the updated date and time }, }, });
[jQuery] [validate] How to integrate validation with masking?
Hello, I am validating a form but one of the fields has a mask: 99-99- 99:99:99 This is: Day-Month-Year Hour:Minutes:Seconds How can I integrate my validation with my mask? I am using: http://digitalbush.com/projects/masked-input-plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ I am not sure if these are the right plugins for this ... at least this is what I have been using. Could someone, please, help me out? Thanks, Miguel Here is my code: // Form mask jQuery(function($){ $(#UpdatedAt).mask(99-99- 99:99:99); }); // Form validation $(#Edit).validate({ errorClass: Error, errorElement: label, rules: { Name: {required: true}, UpdatedAt: {required: true} }, messages: { Name: {required: What is your name?}, UpdatedAt: { required: Insert the updated date and time }, }, });
[jQuery] [validate] Validation + Mask + Regex. Please, help me out. Thank You.
Hello, I am using masking and client validation in a form using: Validator Plugin - http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Masked Input Plugin - http://digitalbush.com/projects/masked-input-plugin In an input I have a Date Time in the following format: -mm-dd hh:mm:ss I am adding the masking as follows: jQuery(function($){ $(#UpdatedAt).mask(-99-99 99:99:99); }); How can I validate my field integrating it with the mask and using a Regex to be sure that the date time is valid? I already have the Regex Expression: ^([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2][0-3]):([0-5] [0-9]):([0-5][0-9])$ The date and time are also required. I already have the following: // Form validation $(#Edit).validate({ errorClass: Error, errorElement: label, rules: { UpdatedAt: {required: true} }, messages: { UpdatedAt: { required: Insert Updated date and time }, }, }); Could someone please help me? I have been trying all day but until now I wasn't able to make this work. Thanks, Miguel
[jQuery] Re: Which grid?
This one: http://webplicity.net/flexigrid/ On Jun 17, 10:02 am, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: Lot of grids and so, I just thought of asking what is the preferred grid by the experts? I personally prefer the combination ofhttp://makoomba.altervista.org/grid/ (for live loading),http://tablesorter.com/docs/(for sorting),http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/(drag drop ordering) Also seenhttp://reconstrukt.com/ingrid/which doesn't work in FF 2 and IE 7. Any comments are appreciated. -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/
[jQuery] Use different CSS class
Hello, As far as I know to style the error messages a error CssClass is used. Can I use another CSS Class? For example, ShowError? Thanks, Miguel
[jQuery] [validate] Use Ajax
Hello, How can I check the value inserted in an Input using Ajax? Thanks, Miguel
[jQuery] [validate] Use Regex
Hello, How can I check the value inserted in an Input using a RegEx expression? Thanks, Miguel
[jQuery] Re: [validate] Use different CSS class
The question is concerning the Validate plugin in http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Thanks, Miguel On Jun 16, 10:58 am, shapper [EMAIL PROTECTED] wrote: Hello, As far as I know to style the error messages a error CssClass is used. Can I use another CSS Class? For example, ShowError? Thanks, Miguel
[jQuery] Re: Release: Validation plugin 1.1.2
Hello, I see. I will try the method. I am trying to integrate your Validation Plugin with ASP.NET and AJAX. Is there something like this already done? Thanks, Miguel On Dec 19, 9:05 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: shapper schrieb: Hello, isn't it possible to use a Regex expression anymore? I need to validate a few inputs text using a regex expression. There wasn't a regex method ever - by design. I still think its much better to encapsulate any (weird and hard to read in a few seconds) regex in a custom validation method:http://docs.jquery.com/Plugins/Validation/Validator/addMethod Let me know if that doesn't work for you. Jörn
[jQuery] Re: Release: Validation plugin 1.1.2
Hello, isn't it possible to use a Regex expression anymore? I need to validate a few inputs text using a regex expression. How can I do this? Thanks, Miguel On Dec 13, 12:24 am, Josh Nathanson [EMAIL PROTECTED] wrote: Good news Jorn. Thanks for an awesome plugin. -- Josh - Original Message - From: Jörn Zaefferer [EMAIL PROTECTED] To: jQuery Discussion. jquery-en@googlegroups.com Sent: Wednesday, December 12, 2007 2:26 PM Subject: [jQuery] Release: Validation plugin 1.1.2 Hi, I've just release version 1.1.2 of the validation plugin. Hot from the changelog: * Replaced regex for URL method, thanks to the contribution by Scott Gonzalez, seehttp://projects.scottsplayground.com/iri/ * Improved email method to better handle unicode characters * Fixed error container to hide when all elements are valid, not only on form submit * Fixed String.format to jQuery.format (moving into jQuery namespace) * Fixed accept method to accept both upper and lowercase extensions * Fixed validate() plugin method to create only one validator instance for a given form and always return that one instance (avoids binding events multiple times) * Changed debug-mode console log from error to warn level So basically all the fixes that were only available using the 1.2 trunk are now available as a regular and stable release. I'm also working on the documentation: http://docs.jquery.com/Plugins/Validation#Documentation It isn't versioned yet, so you'll currently find a few 1.2 only features on that page, nonetheless, its much more up-to-date then what was available so far. Have fun! Your feedback is welcome! Jörn
[jQuery] Fade and Center
Hello, I have 2 divs: div id=parent div id=child /div /div I need to create a function using JQuery that when called does the following: 1. Centers child inside parent 2. Fades in child How can I do this? Thanks, Miguel
[jQuery] Convert to JQuery code
Hello, I am mostly an ASP.NET and SQL developer and I have no experience with JQuery. I am starting to use JQuery now and it seems really good. I need to convert a Javascript code to use JQuery. Could someone, please, help me out? The Javascript code: function onUpdating(){ // get the update progress div var updateProgressDiv = $get('updateProgressDiv'); // get the gridview element var gridView = $get('%= this.gvCustomers.ClientID %'); // make it visible updateProgressDiv.style.display = ''; // get the bounds of both the gridview and the progress div var gridViewBounds = Sys.UI.DomElement.getBounds(gridView); var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv); var x; var y; //do the math to figure out where to position the element if($get('rdoCenter').checked){ // center of gridview x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2); y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2); } else if($get('rdoTopLeft').checked){ // top left of gridview x = gridViewBounds.x; y = gridViewBounds.y; } else{ // top right of gridview x = (gridViewBounds.x + gridViewBounds.width - updateProgressDivBounds.width); y = gridViewBounds.y; } //set the progress element to this position Sys.UI.DomElement.setLocation (updateProgressDiv, x, y); } function onUpdated() { // get the update progress div var updateProgressDiv = $get('updateProgressDiv'); // make it invisible updateProgressDiv.style.display = 'none'; } Note: If possible I would like the function to receive the ID of the updateProgressDiv instead of using updateProgressDiv and the ID of the ASP.NET control instead of using this.gvCustomers.ClientID Could someone, please, help me out? Thank You Very Much, Miguel
[jQuery] Toggle visibility.
Hello, I have an anchor on my page. When I click it I want to Toggle the visibility of a Div with ID = Content. If the div is visible then it should become invisible. If it is invisible them it becomes visible. How can I do this? Thanks, Miguel
[jQuery] Change CSSClass
Hello, I have an anchor. I want to change its CSS class and also disable the clicking when it is clicked. Can I do this with JQuery? Thanks, Miguel
[jQuery] Download JQuery
Hello, I want to download and start using JQuery. Which one should I download? And why the file sizes do no match? For example, for 45.3Kb - http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.min.js 14Kb - http://docs.jquery.com/Release:jQuery_1.2.1 Thanks, Miguel
[jQuery] Get div
Hello, How can I get use a Div given its ID? Or I can only get it given the css class applied to it? Thanks, Miguel
[jQuery] Fade In and Fade Out Div
Hello, I have a DIV in my page and I need to: 1. The DIV must be over all other page content. 2. Select the DIV position: It could be Centered or on Top Right. The DIV should be over all page content. 3. Fade the DIV from a X% opacity to a 0% opacity when: N seconds have past or when the user clicks the rest of the page. How can I do this using JQuery? Thank You, Miguel