[jQuery] Re: validate

2009-12-01 Thread tom
I asked the question on stack overflow:
http://stackoverflow.com/questions/1827483/jquery-validate-plugin-how-to-trim-values-before-form-validation

On Dec 1, 1:50 pm, tom  wrote:
> I'm using the jquery.validation plugin by Jörn Zaefferer and I was
> wondering whether there's a easy way to trim form elements before they
> are validated.
>
> For example, if I'm validating a email address: "t...@test.com   "
> using the "email : true" rule, it'll display an error because the
> trailing whitespace is invalidating the email format. I was hoping I
> could chain "jQuery.trim(value)" before the validation so the
> whitespace is removed and the validation error never occurs?
>
> Disclaimer: The jquery.validation plugin documentation page currently
> isn't working (http://docs.jquery.com/Plugins/Validation) so I can't
> RTFM.


[jQuery] validate

2009-12-01 Thread tom
I'm using the jquery.validation plugin by Jörn Zaefferer and I was
wondering whether there's a easy way to trim form elements before they
are validated.

For example, if I'm validating a email address: "t...@test.com   "
using the "email : true" rule, it'll display an error because the
trailing whitespace is invalidating the email format. I was hoping I
could chain "jQuery.trim(value)" before the validation so the
whitespace is removed and the validation error never occurs?

Disclaimer: The jquery.validation plugin documentation page currently
isn't working (http://docs.jquery.com/Plugins/Validation) so I can't
RTFM.


Re: [jQuery] Re: Is mouse inside a div?

2009-11-16 Thread Tom Lobato

Hi Rick!
yes, over a div. But I need to know if the mouse is or not over it.
I made it setting a flag in the callbacks of the hover event:

// show/hide gallery
var is_over = false;
$("#ftdest_forum").hover(function(){
is_over = true
chvis(1.0)
}, function(){
is_over = false
chvis(0.0)
})

Thank you!

Rick van Hoeij escreveu:
> Hey,
>
> Don't know if you mean when you hover over a div? Cause then you
> should just use the hover event:
>
> $('#divid').hover(function(){}
>//Implement code while hovering
>,function(){
>   // Implement code when you exit the div
> });
>
> Hope this helps.
>
> Greetz,
>
> Rick
>   



Re: [jQuery] Re: Is mouse inside a div?

2009-11-16 Thread Tom Lobato

Hi Shane,
great, it works!
thank you :)

Shane Riley escreveu:
> You can attach the mouseenter event to the div like this:
> $('div').mouseenter(function() { // Do stuff });
>
> Documentation is at http://docs.jquery.com/Events/mouseenter
>
> On Nov 15, 3:30 pm, Tom Lobato  wrote:
>   
>>   Hi,
>>   in first, these days I started to play with jquery and I`m
>> impressed, excellent library!
>>   Well, I already done some cool things, but I can`t find
>> how to check wheter the mouse pointer is inside a div.
>>   Any hints?
>>
>>   Thank you!
>> 



[jQuery] Is mouse inside a div?

2009-11-15 Thread Tom Lobato

  Hi,
  in first, these days I started to play with jquery and I`m
impressed, excellent library!
  Well, I already done some cool things, but I can`t find
how to check wheter the mouse pointer is inside a div.
  Any hints?

  Thank you!


[jQuery] Superfish sfHover IE6 - only seems to work on right click

2009-11-05 Thread Tom Simnett
Hi,

I'm having a bit of trouble with the Superfish jQuery plugin. I've got
the CSS working such that if I put the class sfHover on an  it
shows the right styles in IE6.

When I don't do that, and roll my mouse over either the link or the li
tags, nothing happens. However, oddly, when I right click with the
mouse, it then applies the class.

The code looks like this, and uses the basic Superfish call as per the
example:


What We Do
How We Do It
Who We Are
    Blog


Tom


[jQuery] Accordion in IFrame

2009-10-07 Thread Tom

Hello,

I am working with DotNetNuke and the Accordion widget from JQuery.
The problem is that the DNN-page is loaded in an IFrame so i cannot
acces the accordion.





The contents of the IFrame is loaded dynamically.
I have tried to acces it this way:
$(""#frmDNN #accordion"").accordion({ header: ""h3"" });
and many other ways, but still can't find the solution if it excists.

So can someone help me with this.

Thanx in advance...


[jQuery] Replacing entire page.

2009-09-05 Thread tom

Hello,

I am trying to replace the entire page when the user selects a
different option in a combo box. The code I have works for the first
iteration. However, It fails everytime there after.  I went through
firebug and it appears after the first refresh it never triggers the
ready() method.

Any help is appreciated.

My Code is,



$(document).ready(function() {
$("#id_company").change(function () {
var data = {};
data.company = $(this).val();

$.get("/ajax/search/", data, function(responseData){
$("html).html(responseData)
}, "html");
});
});




[jQuery] Re: event handlers that run after the browser's default action

2009-08-21 Thread Tom Worster

i was interested in using the value of a text input immediately after the
browser has finished handling a keyboard event.


On 8/21/09 10:14 AM, "ak732"  wrote:

> 
> Not sure that there's a more deterministic approach - if so, it's
> beyond my limited Javascript knowledge.
> 
> Specifically what are you trying to accomplish by wiring an event
> handler to fire after the default action?
> 
> On Aug 20, 10:39 pm, Tom Worster  wrote:
>> thanks.
>> 
>> i thought of using a timeout and it could probably be made to work fairly
>> well. but i'd be left with the worry that some user's crummy old browser and
>> computer that's too busy doing other things might need a longer delay than i
>> set.
>> 
>> we can insert event handlers at the beginning of the event propagation
>> chain. or catch the event later as it bubbles. but i've never heard of
>> attaching a handler to the chain after the browser has done its bit. i was
>> wondering if this was just my ignorance or if it just can't be done that
>> way.
>> 
>> On 8/20/09 8:45 PM, "ak732"  wrote:
>> 
>> 
>> 
>>> This is crude, but might work for you...
>> 
>>> $("#someId").click()(function() {
>>>   set_timeout(function() {
>>>     // stuff to be done 2ms from now
>>>   }, 2);
>>> });
>> 
>>> You might have to play with the set_timeout delay a bit, 2ms might be
>>> too short.
>> 
>>> On Aug 20, 3:47 pm, Tom Worster  wrote:
>>>> is there a way to set up a page so that a event handler function is bound
>>>> to
>>>> a DOM object and event but it runs _after_ the browser's default action is
>>>> complete?




[jQuery] Re: event handlers that run after the browser's default action

2009-08-20 Thread Tom Worster

thanks.

i thought of using a timeout and it could probably be made to work fairly
well. but i'd be left with the worry that some user's crummy old browser and
computer that's too busy doing other things might need a longer delay than i
set.

we can insert event handlers at the beginning of the event propagation
chain. or catch the event later as it bubbles. but i've never heard of
attaching a handler to the chain after the browser has done its bit. i was
wondering if this was just my ignorance or if it just can't be done that
way. 


On 8/20/09 8:45 PM, "ak732"  wrote:

> 
> This is crude, but might work for you...
> 
> $("#someId").click()(function() {
>   set_timeout(function() {
> // stuff to be done 2ms from now
>   }, 2);
> });
> 
> You might have to play with the set_timeout delay a bit, 2ms might be
> too short.
> 
> On Aug 20, 3:47 pm, Tom Worster  wrote:
>> is there a way to set up a page so that a event handler function is bound to
>> a DOM object and event but it runs _after_ the browser's default action is
>> complete?




[jQuery] event handlers that run after the browser's default action

2009-08-20 Thread Tom Worster

is there a way to set up a page so that a event handler function is bound to
a DOM object and event but it runs _after_ the browser's default action is
complete?




[jQuery] time entry controls (e.g. timeEntry plugin)

2009-08-19 Thread Tom Worster

does anyone use a jquery time entry control? which one?

i'm looking at this one: http://keith-wood.name/timeEntry.html which seems
ok. i'd be interested to know what others are using and what you think of
them.




[jQuery] Re: animate image position

2009-08-11 Thread Tom Cool

Hey Paul,

Thanks for the quick reply. Due to legal issues i can't give you an
example or demo page i am afraid.
I am very curious to what others have experienced during development
of related animations.
It is simply animating a large image (500x500 - reduced res) from left
to right (380px).

Please, any ideas.

Tom

On Aug 10, 10:35 pm, Paul Mills  wrote:
> Hi,
> Can you post an example of your animation code or link to a demo page.
>
> Paul
>
> On Aug 10, 4:39 pm, Tom Cool  wrote:
>
> > Hi,
>
> > I'm experiencing a large amount of flickering in a image i move with
> > animate(). Looking at jQuery's source code, i think it has something
> > to do with the setInterval it uses to calculate the animation; when
> > binding the animation to 'mousemove' its runs smoothly.
>
> > Any ideas on how to improve this animation?
>
> > Thanks,
> > Tom.


[jQuery] animate image position

2009-08-10 Thread Tom Cool

Hi,

I'm experiencing a large amount of flickering in a image i move with
animate(). Looking at jQuery's source code, i think it has something
to do with the setInterval it uses to calculate the animation; when
binding the animation to 'mousemove' its runs smoothly.

Any ideas on how to improve this animation?

Thanks,
Tom.


[jQuery] Re: [Autocomplete] Form submit or link on mouse click or return key

2009-07-21 Thread Tom Worster

On 7/20/09 1:06 PM, "koichirose"  wrote:

> Hello, I'm using jQuery Autocomplete (
> http://docs.jquery.com/Plugins/Autocomplete
> ) to display results from a php page.
> 
> Since that is my only field, I want to submit the form when I click on
> the result or I press the 'return' key.
> 
> How do I do that?
> 
> The result is showing something like 'artist - album' and I'd like to
> post only the artist .
> 
> Also, it would be event better without a form submit: the results
> would have their own php-generated link to another php page with
> artist passed as a $_GET variable. I click or press enter on them and
> it would work just like a link.
> 
> Is there a way to achieve that, either by submitting the form or by
> linking to the new php page?

take a look at result() documented on the page you liked above. you should
be able to program the functionality you want in a result() handler.




[jQuery] Re: Autocomplete - finding out (on blur) if the user has picked an item from the list or not

2009-07-03 Thread Tom Worster

On 7/2/09 5:49 AM, "gnjunge"  wrote:

> Concerning Jörn Zaefferer autocomplete.
> 
> In many cases the autocomplete list is being filled with Key Value
> pairs, such as a list of FooBars with their name and id. Using the
> result function one would get the id, and drop it into a hidden field.
> 
> I want to allow users to either pick an existing FooBars from the
> list, or enter a new one if he cannot find a suitable one. But for
> that to work I need to know that the autocomplete box contains a
> custom item, with other words: an item that was not in the list.
> 
> The result event is only triggered whenever an item was picked from
> the list.
> 
> How would I go about implementing this. My starting point was to add
> code to the "blur" event of the autocomplete, yet I can't get enough
> information to see if the currentValue is from the list, or a custom
> entry.

what i did was add a flag in the input's .data() called 'chosen'. i set the
flag in the input's .result() handler. i clear it on .change(), or on
.focus() if the input's value is an empty string.

the flag can be read whenever to determine if the value in the field is
chosen from the suggestions or typed.




[jQuery] Re: howto: using autocomplete and validate (with remote) together

2009-06-30 Thread Tom Worster

On 6/30/09 9:03 AM, "hobbesdev"  wrote:

> 
> hi,
> 
> i have in input element where the user can enter multiple email
> addresses (like in thunderbirds to: field)
> i use autocomplete to make suggestions form the database when the user
> enters new adresses.
> then i want to validate the emailadresses before sending the email,
> because the user can add email addresses by 1.) lookup or 2 manual editing
> so i used validate with
> 
> var validator = $j("#werkeForm").validate({
> rules: {
> empfaenger:{
> required: true,
> minlength:2,
> remote: "ajaxserver2.php?cmd=chkEmail"
> },
> 
>
> now the problem seems to be a kind of race condition, cause both methods
> try to operate on the input field.
> 
> firebug shows me that each method takes only a few milliseconds, but
> combined they take up to 3 secondes after every keystroke.
> 
> is there any advice on how to combine these both plugins?

could you try invoking the undocumented method .unautocomplete() before
invoking validate()?

i don't know how fancy your validation is but with fancy autocompletion
happening it might be easier on the user if email address validation only
happens on form submit. that approach would allow you to turn off
autocompletion before doing any validation.




[jQuery] Re: [autocomplete][livequery] .change()

2009-06-29 Thread Tom Worster

On 6/26/09 11:14 AM, "lazytt"  wrote:

> 
> Hello. I'm having a problem with the following code:
> 
> $(".prodname").livequery(function(){ $(this).autocomplete
> ("search.php", {
> extraParams: { 'type':'products' }
> }); });
> 
> $(".prodname").livequery(function(e){ $(this).change(function(e) {
> $(".barcode."+thisline(e)).val('');
> $.ajax({
> type: "GET",
> url: "agent.php",
> data: "prodname="+$(".prodname."+thisline(e)).val()
> +"&action=getprodid",
> success: function(text){
>  $(".prodid."+thisline(e)).val(text);
> }
> });
> }); });
> 
> It seems that the change event doesn't auto-bind to new elements.

i wouldn't expect so. adding an element to the dom isn't an onChange event.


> If I
> use .click() it works fine. If I remove the auto complete it works
> fine. And the .change() gets triggered just fine on static elements -
> the problem is only on  new (ajaxly added)elements.

what i do to add a autocomplete to new, ajax-added dom elements is:

$(window).ajaxStop(function() {
   ... code to add autocompletes here ...
});




[jQuery] Re: JQuery Autocomplete - conditional autocompletion between fields

2009-06-29 Thread Tom Worster

to set extraParams dynamically to the current value of other dom elements,
assign a function to the extraParams that retrieves the value from the dom,
e.g.

$("#state").autocomplete(url, {
extraParams: { 
town: function() { return $("#town").val(); }
} 
});

see http://docs.jquery.com/Plugins/Autocomplete#Dependencies_between_fields

alternatively, you can assign a static value, that of the input then the
autocomplete() method was involked (probably at page steup time), using
MorningZ's code quoted below.


now, to address your other question, if you also have:

$("#town").autocomplete(url, {
extraParams: { 
state: function() { return $("#state").val(); }
} 
});

then your backend at url can infer which input the user is typing into from
the GET parameter names sent.


but if you want, you could add another static parameter to explicitly say
what is being sent in the q parameter rather than inferring from the other
parameter names, e.g.:

$("#state").autocomplete(url, {
extraParams: { 
qis: 'state',
town: function() { return $("#town").val(); }
} 
});
$("#town").autocomplete(url, {
extraParams: { 
qis: 'town',
state: function() { return $("#state").val(); }
} 
});



On 6/28/09 3:23 PM, "MorningZ"  wrote:

> 
> Use AutoComplete's "extraParams" hook
> 
> http://docs.jquery.com/Plugins/Autocomplete/autocomplete#toptions
> 
> so it would be like:
> 
> $("your state search textbox").autocomplete(
> "/ajax/location.php",
> { extraParams: { type: $("#state").val() } }
> );
> 
> 
> 
> On Jun 26, 12:34 pm, 01101010001010001010 
> wrote:
>> Hi,
>> 
>> First of all, thanks for the autocomplete code - it's excellent.
>> Apologies if this next question is too simple, but I couldn't get the
>> answer on google (lmgtfy.com)
>> 
>> I have two autocomplete fields, for address-matching, which for the
>> sake of argument could be called state and town.
>> 
>> I have autocomplete on state go to /ajax/location.php?type=state and
>> autocomplete on town go to /ajax/location.php?type=town
>> 
>> My location.php script works fine delivering autocomplete results for
>> each field individually.
>> 
>> I want to pass the contents of ${#state} to the script when
>> autocompleting town (so it will only autocomplete for towns in the
>> already-chosen state).
>> 
>> I can't see how to tell autocomplete to pass ${#state}.val in the call
>> for town.
>> 
>> Any thoughts gratefully received - and thanks again for the brilliant
>> code.
>> 
>> Peter




[jQuery] Re: ajax load

2009-06-27 Thread Tom Worster

On 6/27/09 11:15 AM, "Peter Marino"  wrote:

> when I use the $(".main_view").load( "my.php" );
> all my danish letters are rendered wrong.
> is there something I need to do in the my.php to make sure it
> shows the danish characters correctly?
> 
> anyone?

perhaps my.php is returning the text encoded using a different character
encoding from the page it's being loaded into.

for example, say we have a page that's encoded as iso-8859-1, the server
says that's the encoding and the user agent understands and displays it
nicely. then, via ajax and js, utf-8-encoded text is retrieved from the
server and inserted into the page's dom. i would expect the user agent to
render the text as though it were iso-8859-1 and that would be a problem.
i've never tried it but i'd be surprised if the user agent would notice the
mismatch and perform a conversion.

there could be other explanations but this is worth checking.




[jQuery] Re: Autosuggest based dropdown selection plugin

2009-06-27 Thread Tom Worster

On 6/27/09 5:11 AM, "bharani kumar"  wrote:

> Hi all ,
> I used the auto suggest / complete in my lot of projects ,
> 
> 
> But this is some what different ,
> 
> I need the auto suggest plugin   , that auto suggest
> must  work based on the dropdown selection ,
> 
> Assume if select the airport , the airports data only populate or show in
> the suggest , not an alll ,
> 
> -- Autosuggest airport seaport stations

how about putting the value of the select in extraParams and then have your
backend for the usual autocomplete plugin return only relevant suggestions?




[jQuery] Re: Autocomplete Behavior clarification

2009-06-12 Thread Tom Worster

On 6/10/09 1:17 PM, "Brad"  wrote:

> 
> I have an Autocomplete on a form that uses local data. However, the
> input allows users to enter values that are not in the local data
> array. If the user enters and selects matching data the .result
> callback function sets a corresponding key value that is submitted
> with the form. The intent is to help enter known values, but others
> are allowed.
> 
> What I'm observing is that if a match is entered, the corresponding
> key will be set. But if the user further edits the matched value the
> autocomplete doesn't fire again. This creates a problem because the
> key never changes. Is that expected autocomplete behavior? If so, is
> there a workaround?
> 
> Here's the code:
> 
> $("#calibration_location_name").autocomplete( locations, {
> minChars: 0,
> width: 310,
> selectFirst: false,
> scroll: true,
> matchContains: "word",
> mustMatch: false,
> autoFill: false,
> formatItem: function(row, i, max) {
> return row.name;
> },
> formatMatch: function(row, i, max) {
> return row.name;
> },
> formatResult: function(row) {
> return row.name;
> }
> })
> .result(LocationAutoCompleteCallback)
> .blur( function(){
> if($(this).val() === '') {
> $("#calibration_locationkey").val(0);
> }
> });

i'm not sure i understand your problem entirely but my guess is that the
formatX methods aren't necessarily the right solution for your problem. if
what you want is to submit the key associated with the string in the input
if and only if one exists in your array then you could perhaps do the key
lookup at form submit time quite independently of the autocompletion plugin. 




[jQuery] Re: autocomplete

2009-06-12 Thread Tom Worster

On 6/10/09 1:11 AM, "smiling_face"  wrote:

> 
> first of all thanks for your gr8 plugins to add autocomplete feature
> using jquery. but I am facing a problem to implement this in my
> application. As in error console it is showing
> syntext error
> .ac_results {
> 
> 
>  and showing the list of probables as simple ul viwe (with bullets)
> plz suggest me further.
> 
>  I am using  Revision: $Id: jquery.autocomplete.js 5747 2008-06-25
> 18:30:55Z

are you using the stylesheet that comes with the plugin?




[jQuery] Re: autocomplete

2009-06-05 Thread Tom Worster

On 6/5/09 3:37 AM, "BBCLX"  wrote:

> I am using the plugin in "remote-mode" meaning that I fetch a
> seperated list from my server. The problem now is that this server
> uses basic authentication and whenever I start typing I get prompted
> for the username and password, which is quite annoying.
> 
> The jQuery Form Plugin for example allows to send username and
> password for authentication, which are in fact plain $.ajax
> parameters. Is such a method possible for the autocomplete plugin as
> well or how could I possibly work around this problem?

not for "basic auth" which is handled in http. you need to fix this on the
server. i don't think there's much point in user auth for autocompletion
lookups so i would turn it off.




[jQuery] Re: [autocomplete] hard time with accent

2009-06-05 Thread Tom Worster

On 6/4/09 2:17 PM, "James"  wrote:

> What are you using to do the string matching?

depends on the kind of search i need.

> For me, I was using autocomplete to search for something stored in a
> MySQL database, 

i think that's a very common scenario.

> and MySQL by default automatically matches even those
> strings with accents from non-accented characters.

according to collation.

> It should either be
> the script or the database that handles this conversion/matching.

if by "script" you mean client script then i can't agree. say i wanted more
than a simple search, i want exact matches frist, then prefix matches in
lexical order, and finally fuzzy matches in Damerau-Levenshtein order with
lexical suborder. the right place for much of that work is in the backend
script.

btw: if you use a php backend then converting character encodings is very
easy.




[jQuery] Re: [autocomplete] hard time with accent

2009-06-04 Thread Tom Worster

On 6/3/09 11:55 PM, "Gustavo Salomé"  wrote:

> No way you can do this unless you do have 'switch' that converts all
> elements to its respective non-utf8 code.

how is the search string encoded in the q parameter sent to the backend?

whatever conversion is needed, isn't it easier to do in the backend than in
client js?


> 2009/6/2 Tom Worster 
> 
>> 
>> On 6/1/09 2:48 PM, "Gui"  wrote:
>> 
>>> I'm currently using this JQuery autocomplete plugin. It fits my needs,
>>> pretty cool, however I'm having a hard time with accents. If I type:
>>> Antonio, the plugin won't retrieve Antônio. I mean, it won't handle
>>> the special characters (á, à, é, í, ó, ú and so on.)
>>> 
>>> Is there any option so that it can handle them?
>> 
>> for the local database, i'm not aware of one. if you're using ajax and
>> remote back end then maybe you can handle this in your script. if using
>> mysql backend, perhaps setting a different collation and tweaking your
>> query
>> is all you need.
>> 
>> 
>> 
> 




[jQuery] Re: [autocomplete] - Problem closing autocomplete

2009-06-03 Thread Tom Worster

On 6/3/09 10:49 AM, "AlexKV"  wrote:

> If the Autocompleter ist active and I click somewhere else on the page
> to close the autocompleter, the autocompleter inputbox will be
> focused. Can I change this behavior? I want that the autocompleter
> will be closed if I click somewhere and that the clicked element will
> be focused.
> The examples on the Demopages have the same behavior.

it's annoying, isn't it? i tried to sort it out and failed. if you find a
solution, please post it here.




[jQuery] Re: [autocomplete] hard time with accent

2009-06-02 Thread Tom Worster

On 6/1/09 2:48 PM, "Gui"  wrote:

> I'm currently using this JQuery autocomplete plugin. It fits my needs,
> pretty cool, however I'm having a hard time with accents. If I type:
> Antonio, the plugin won't retrieve Antônio. I mean, it won't handle
> the special characters (á, à, é, í, ó, ú and so on.)
> 
> Is there any option so that it can handle them?

for the local database, i'm not aware of one. if you're using ajax and
remote back end then maybe you can handle this in your script. if using
mysql backend, perhaps setting a different collation and tweaking your query
is all you need. 




[jQuery] Re: browser detection, conditional CSS

2009-06-01 Thread Tom Worster

On 6/1/09 1:16 PM, "waseem sabjee"  wrote:

> i good thing to do is to declare this styles on your default / index page
> /*
> keep your page defaults the same across each browser
> */
> html {
> width:100%;
> height:100%;
> }
> /*
> declare the initial margin and padding of each element to be 0, 0
> */
> * {
> margin:0;
> padding:0;
> }

this principle is sound, though i had trouble with resetting * and now use
the following default reset:

html, body, div, span, object, iframe, h1, h2, h3, h4, h5,
h6, p, blockquote, pre, a, abbr, acronym, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table,
caption, tbody, tfoot, thead, tr, th, td {
margin:0;
padding:0;
outline:0;
font-size:1em;
}

> On Mon, Jun 1, 2009 at 6:44 PM, Adam  wrote:
> 
>> 
>> What's everyone's opinion on current best-practice for offering
>> conditional CSS for specific browsers. I just noticed that Jquery used
>> to have a detection function rolled in, which was deprecated. I have
>> been using IE conditional comments to do this for a long while but
>> recently used a WP theme (Justin Tadlock's hybrid) that used http user
>> agent to add classes to the body tag depending on which browser and I
>> sorta liked this approach. Mostly because it actually works in my PC
>> testing enviro. Thoughts? Thanks everyone!

i gave up on browser specific css. i couldn't find a way to do it that
wasn't risky one way or another. when i really need different stylings, i
will use ie conditional html to make the markup different for different
browsers and then use standard css without hacks.

btw: was this a jquery question?




[jQuery] Re: [autocomplete] matchContains in multiple words

2009-06-01 Thread Tom Worster

On 5/31/09 5:36 PM, "Alec"  wrote:

> http://docs.jquery.com/Plugins/Autocomplete
> 
> Say I have the following entry in a data array:
> 
> "Quick brown fox"
> 
> Is it possible to return this entry when I search for e.g. "qui fox"?
> At this moment I can only get this result when searching for "qui" or
> "fox", but not "qui fox". I guess what I'm looking for is a way to
> split the input, and match each part against the data entries.

if you're using local data, i don't know. probably not. if you're using a
remote search, yes, program the search logic in your backend.




[jQuery] Re: AutoComplete with extraParam

2009-06-01 Thread Tom Worster

On 5/30/09 5:15 PM, "Dushyant Patel"  wrote:

> 
> Hi All,
> 
> I am using AutoComplete plug-in, its working great for me. But now i
> have some new requirement and i am not able to make it work with
> autocomplete.
> 
> Requirement is as follow:
> 
> Now i need 2 extra parameter to pass and these two parameter's value
> would be depend on selected value of selected box.
> 
> So let me explain in details:
> 
> $(".mui_search_input").autocomplete('http://weburl/Service.svc/', {
> minChars: 3,
> matchContains: false,
> autoFill: false,
> scrollHeight:200,
> cacheLength: 3,
> mustMatch: true,
> extraParams: { Parm1:"valueofselectionbox1",
> Param2:"valueofselectionbox2"},
> 
> 
> Here valueofselectionbox1 and valueofselectionbox2 are selection box
> next to search box. so i supposed to get values of those selection box
> and pass as extra parameter.
> 
> I tired with following but not working:
> 
> extraParams: { Parm1:"$(.selectbox1).val()", Param2:"$(.selectbox2).val
> ()"},

the extraparams need to be functions. otherwise you just set the params to
whatever values are in those selects at the time you called
$(".mui_search_input").autocomplete()

see http://docs.jquery.com/Plugins/Autocomplete#Dependencies_between_fields





[jQuery] Re: Autocomplete Question

2009-06-01 Thread Tom Worster

On 5/30/09 12:31 PM, "Marc"  wrote:

> I am using jquery.autocomplete in a search for schools. I have
> optional fields (referenced as extraParams) which allow the user to
> narrow the search to a specific state and city.
> 
> This part works fine. If the user selects a state and city and then
> initiates the search be entering a value into the autocomplete field,
> then everything works well.
> 
> My issue is that I need to execute the search and return results to
> the autocomplete field when the user selects a state (and nothing has
> been entered into the autocomplete field).
> 
> Obviously, I have an onChange event in the State field which can
> trigger the search event, but I don't know how to manually cause the
> search to occur (passing a wildcard for the value of q).
> 
> Any suggestions would be GREATLY appreciated.

this question comes up periodically here. look in the archive for a thread
called "Autocomplete plugin for multiple form fields from a JSON source".

the kernel is to set minChars to 0 and then when you send two 'click' events
to the field when you want the suggestions to pop open, e.g. inside your
.result() event handler for state input, put:

$("#city").setOptions({minChars: 0}).trigger('click').trigger('click');

or it could go in an onfocus handler on the city field, as you wish.




[jQuery] Re: Autocomplete two fields

2009-06-01 Thread Tom Worster

On 5/30/09 5:15 AM, "Adrian Grigoras"  wrote:

> I use JQuery.Autocomplete to autocomplete values into one field.
> Depending on the first field, I also need to populate a second field.
> 
> For example:
> 
> I autocomplete the Name field and depending on the selected name I
> need to autocomplete also Phone field.
> 
> It's possible to do that?

it seems so. look at the Single Bird (remote) example here:

http://jquery.bassistance.de/autocomplete/demo/

the backend returns an array with two members for each suggestion, the
members being separated by the | character. autosuggest takes the first
member for the field with autocomplete. a .result() handler takes the second
member and puts it in the other field ('Hidden input').

this rather powerful trick of passing an array back for each suggestion
seems to be undocumented. but you can see it by reading the demo source and
observing the results from, say
http://jquery.bassistance.de/autocomplete/demo/search.php?q=rob
also look in function parse(data), line 371 of the plugin:
row = row.split("|");

presumably you can use lots of array members on each row of results.




[jQuery] Re: Jquery Autocomplete Problem

2009-05-24 Thread Tom Worster

i assume you are using this plugin?
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

if so, why did you put the call to autocomplete() inside an event handler?

normally autocomplete() is called on page ready and it establishes its own
event handlers.
 

On 5/22/09 1:50 PM, "the_guru"  wrote:

> my script is->
> 
> $(".stock_item").live("keypress",function(){
> console.log($(this));
> $(this)
> .autocomplete("includes/pages/stock_item_autocomplete.php",{
> width:150,
> max:5,
> multiple: true,
> }).result(function(){
> 
> var name= $(this).val();
> 
> if(name.match("#")){
> var stock_id= parseInt( name.split("#")[0]);
> 
> $(this).val(name.split("#")[1]);
> 
> $(this).next("input[name=stock_item[]]").val(stock_id);
> }
> });
> 
> });
> 
> this script gets the 1#Nokia1166 and stores the 1 into the hidden
> field but
> my problem is it does not trigger even on the first time and some time
> not at all
> 
> help needed please




[jQuery] Re: Recommendations for jQuery method to play mp3 audio

2009-05-20 Thread Tom Worster

On 5/20/09 10:02 AM, "SamCKayak"  wrote:

> Is there a cross-browser jQuery plug-in that can preload several
> different mp3 audio files and provide play / stop methods?

yes. http://plugins.jquery.com/search/node/mp3+type%3Aproject_project

but for mp3 i really like 1bit. but it is not dependent on jquery so it may
not meet your needs: http://1bit.markwheeler.net/




[jQuery] Re: [autocomplete] change ?q= to predefined param name or get field value for extraParams call

2009-05-20 Thread Tom Worster

On 5/19/09 3:36 PM, "jakemonO"  wrote:

> 
> Is there a way to change the ?q= parameter name to something that was
> predefined by the JSON emmitter? For example, Lotus Domino expects the
> querystring to be of the form "?Startkey=... ". Alternately, I can put
> that query in the extraParams call,

without modifying the plugin, i think that's what you have to do.

> but how do I populate the value
> portion of extraParam? Is there a(n efficient) way for me to
> accomplish what the autocompleter is accomplishing internally with its
> lastWord($input.val()) call?

i'm not sure what your question is but have you read:

http://docs.jquery.com/Plugins/Autocomplete#Dependencies_between_fields




[jQuery] Re: [autocomplete] Can I validate and update the entered value before doing the search?

2009-05-18 Thread Tom Worster

On 5/18/09 2:57 AM, "ulf.ren...@gmail.com"  wrote:

> My best though right now is to patch the plugin to include another
> option - substituteValue - which could be a function that validates
> and rewrites the data in any desired way before the match is done.

i've thought in the past that a useful feature of the plugin would be an
option to specify a general purpose search handler function. the plugin
would call this handler when it has a search key that it wants suggestions
for (either local or ajax search). it's a similar idea.




[jQuery] Re: [autocomplete] Can I validate and update the entered value before doing the search?

2009-05-15 Thread Tom Worster

On 5/14/09 8:58 AM, "Ulf Renman"  wrote:

> When typing data into the autocomplete-field the list of matches is updated
> at every key pressed.
> Is it possible in any way to check and correct the data before doing the
> match. Or could you alter the way the match is done.
> 
> The perfect example is when you have lots of users entering decimal values
> into a filed. Some people uses comma and some decimal-point. So you would
> like to permit both "2.23" and 2,23" to be matched against 2.23 in the list.
> 
> I have some other usecases aswell so I would really like some suggestions on
> this.

it allows you to format the suggestions from the backend but i'm not aware
of the plugin having any feature for processing the field value before
sending it to the backend. can't you do that processing in the backend
itself?




[jQuery] Re: chained select box

2009-05-14 Thread Tom Worster

On 5/14/09 3:20 AM, "phusys"  wrote:

> I need to show 3 select box (country, state, city) with data get from
> a mysql database and when a user select a value from one of the select
> box the other shows chained data.
> How can I do this with jquery?

fill the first select before delivering the form to the user.

when the user selects from the first, use ajax to get data to use as options
in the second.

when the user selects from the second, use ajax to get data to use as
options in the third.

e.g. you could write the backend to format the data into html options and
then .load() them into the form select element.




[jQuery] Re: JQuery and Ajax

2009-05-13 Thread Tom Worster

On 5/13/09 2:23 PM, "nat"  wrote:

> I am working on adding asynchronous form submission inside a jquery
> dialog. I am using .ajax().
> Everything is working correctly, but the submission takes longer than
> I would like.
> I am new to jquery and am unsure how to debug/optimize this. How do I
> determine if the lag is in the front or backend?

in safari, the web inspector will show you timings.

and you could add code to your backend script to time its execution.

then you can figure if the delays are frontend, network or backend.

but i'd be surprised if it was frontend unless you're doing something odd in
the client script.




[jQuery] Re: How to implement autocomplete with cross domain json with custom parameter

2009-05-11 Thread Tom Worster

On 5/11/09 2:46 PM, "Dushyant Patel"  wrote:

> I tried and tired also, finding the way how can i implement
> jQuery.Autocomplete plugin with cross domain json?
> 
> Can any one help me? or provide me link for that instruction?

not me. but this is worth reading:
http://en.wikipedia.org/wiki/Same_origin_policy




[jQuery] Re: [autocomplete] Search Page Replacement

2009-05-10 Thread Tom Worster

On 5/8/09 3:36 PM, "Logan  Green"  wrote:

> This tab issue is driving me crazy.  Has anyone found a hack/fix that
> will allow the tab to work as expected...where the user hits tab once,
> and moves to the next field?

not that i am aware of.

given the activity on this plugin (it's been nearly a year since 1.02) i'm
pretty much resigned to coding my own. i think that will probably be easer
than dealing with my own branch of the plugin, which is much more flexible
(and therefore complex) than my requirements demand.




[jQuery] Re: [autocomplete] Bug in click function

2009-05-06 Thread Tom Worster

On 5/5/09 1:59 PM, "tudela"  wrote:

> 
> Hi, I was using the autocomplete and found a bug in the click
> function, follow the code:
> 
> Actual code:
> // In this code you need to click twice in the input element to show
> the results.
> .click(function() {
> // show select when clicking in a focused field
> if ( hasFocus++ > 1 && !select.visible() ) {
> onChange(0, true);
> }
> 
> Fixed code:
> // I just added ">=" instead of ">", so you only need one click to
> show the results
> .click(function() {
> // show select when clicking in a focused field
> if ( hasFocus++ >= 1 && !select.visible() ) {
> onChange(0, true);
> }
> 
> That's it...

there's an email thread in the archives of this list that shows that the
two-clicks to show is intentional design. i have to admit i don't understand
why it was designed this way. but when i made the same change that you
explain above, it caused other UI problems with my app (sorry, i can't
remember what) so i changed it back.




[jQuery] Re: [autocomplete] disable submit until valid selection is made

2009-05-06 Thread Tom Worster

On 5/5/09 7:51 PM, "Seth"  wrote:

> I have a situation where the only valid inputs on my autocomplete
> field are the ones supplied by my ajax method. Is there a way to
> disable the submit button on my form until the input field contains
> one of the autocomplete values?

could you perhaps enable the submit button with result()?

http://docs.jquery.com/Plugins/Autocomplete/result#handler




[jQuery] Re: [autocomplete] Invoking autocomplete dropdown on focus, before user types

2009-05-06 Thread Tom Worster

On 5/5/09 6:09 PM, "Mike Harris"  wrote:

> Does anyone know how I can get the autocomplete dropdown list of
> values to appear when the text field gains focus, before the user
> types anything.  I've been trying to do this, and have so far been
> unsuccessful.  Any help would be greatly appreciated.

let me know if this works:

$(selector).focus(function(){
  $(this).setOptions({minChars: 0}).trigger('click').trigger('click');
}

where selector selects your text field.




[jQuery] reading show/hide state

2009-04-27 Thread Tom Worster

when using show() and hide(), what's the right way for the script to read
the state of the element? i've found that attr('display') can be used but
this seems like an undocumented hack and could fail in future releases of
jquery. 




[jQuery] Re: [autocomplete] Search Page Replacement

2009-04-27 Thread Tom Worster

On 4/27/09 5:25 AM, "Matthew Vickery"  wrote:

> Thanks for your reply.  I see what you mean about the tab key...  I hope
> someone offers you some advice so you can use the plugin without branching.

i already have an auto-completion of my own that i wrote a few years ago
before i knew of jquery. it requires only about 10% of the locs that
autocomplete plugin uses because it only does what i need and not all that
other stuff too. rewriting my code for the new app (maybe using jq) is
perhaps less work than maintaining my own version of the plugin.

i'm willing to take a bet on jq being around and supported in future. i'm
not sure about autocomplete.


>  If you do find a solution I'd be glad to hear it too.  Did you see my
> response re; 'selectFirst: false' ?  I don't know if this would help your
> problem but it solved mine.

it helps but it's not enough. for an example with "selectFirst: false":

1. go to http://jquery.bassistance.de/autocomplete/demo/

2. click in the "Single Bird (remote):" text input.

3. type, say, "pal" and wait for the suggestions to appear.

4. hit tab.

in my browser, the "Get Value" button focuses for a moment then the focus
moves back to the "Single Bird (remote):" text input. it takes two tabs to
get the focus out of there. that really runs against user expectations and
makes no sense. for people used to working fast through forms with the
keyboard only, this behavior will be inexplicable and annoying.




[jQuery] Re: [autocomplete] Search Page Replacement

2009-04-27 Thread Tom Worster

On 4/26/09 9:31 PM, "Jordon Bedwell"  wrote:

>> this is one of two counter-intuitive keyboard behaviors i'm aware of. the
>> other is tab, which most users would expect to get them to the next form
>> element.
> 
> I'm still scratching my head at how this is counter-intuitive? If you called
> it that, you must not understand the entire scope of tab, and the fact that
> it has no scope, it loops through the entire frame of the browser, including
> the address bar and links.  With JavaScript you can prevent it from looping
> through links and the address bar by defining where it goes and what it
> does. YES, if it did infact stay within forms if you select a form element
> it would be counter-intuitive, but at this point, it is far from that based
> on logic.  There are also more reasons to redine the default behaviour of
> tab.

turning tab into a select, i..e making it work like enter, is counter-
intuitive, to me. autocomplete does that.

if you're in a form and the focus is on a text input and the form layout
shows that the next form element is, say, another text element, you'd expect
tab to get you to it. but with the autocomplete plugin, hit tab to move to
the next input and what you typed gets over-written by a suggestion. that's
not just unexpected, it's annoying.




[jQuery] Re: [autocomplete] Search Page Replacement

2009-04-26 Thread Tom Worster

On 4/26/09 9:12 AM, "mattvick"  wrote:

> I need the list of results to appear without any of them highlighted
> so hitting the return key submits the form without updating the text
> in the search field.  I still need the search field to update, and the
> form submit, if any of the results in the list are highlighted and
> clicked manually.

this is one of two counter-intuitive keyboard behaviors i'm aware of. the
other is tab, which most users would expect to get them to the next form
element.  


> Will someone please point me in the right direction or even better
> post an example so others can also benefit.

i don't know for sure but i suspect that in most cases, changing the
autocomplete keystroke behaviors requires changing the plugin code.

which is a bit of a problem. i'd really like to use autocomplete in my app
but without support (the author hasn't answered any email about autocomplete
this month, afaict), seems like making it behave in a way that users won't
complain about is going to mean branching.




[jQuery] Re: autocomplete

2009-04-26 Thread Tom Worster

On 4/26/09 2:06 PM, "Marc"  wrote:

> 
> I have a silly question...
> 
> I am using extraParams to pass additional field values via the URL
> 
>$("#findHighSchool").autocomplete("autocomplete_ajax.cfm", {
>width: 260,
>selectFirst: false,
>extraParams:{ STATE:function() { return $("#STATE").val
> ();}
>}
>});
> 
> This works correctly. I need to pass a CITY field as well as STATE.
> How do I configure the second extra parameter? All the syntax I've
> tried fails to work.
> 
> Do you use multiple extraParams lines or pass both params on the one
> line?
> 
> Any help greatly appreciated.

it's hardly a silly question. see if this works:

extraParams:{
  STATE:function() { return $("#STATE").val(); },
  CITY: function() { return $("#CITY").val();  }
}

something like that works in my app.

it would be sweet if you could write something like:

  extraParams: function() { ... }

and have your function return an object with lots of extra params. i looked
at the plugin and it didn't seem easy enough for me to be willing to
attempt.




[jQuery] jquery array

2009-04-25 Thread Tom Shafer

I need to make a array from a list

data>
data2>
data3>

I am having a hard time using  jQuery.makeArray() to make an array
from the data and print it out. How can this be done.
Thanks

-Tom


[jQuery] Re: refactoring code

2009-04-25 Thread Tom Worster

On 4/24/09 7:39 PM, "Calvin"  wrote:

>   Does anyone have any advice in regard to refactoring jQuery code to
> make it more efficient/elegant/simple?

certain coding styles are implied by the jq apis, e.g. chaining, that i
think may lead to efficiency gains. i've been reading other people's code to
get ideas and learn. plugins are a place to look.




[jQuery] Re: Autocomplete Question

2009-04-24 Thread Tom Worster

On 4/23/09 10:27 PM, "pjecty"  wrote:

> Is there's a way to link each seach result value in the localdata.js
> to another page so that when i search for something and click it, it
> goes to another page?

could you write such redirection into a .result() handler?

http://docs.jquery.com/Plugins/Autocomplete/result#handler




[jQuery] Re: Some pseudo help if you'd be so kind?

2009-04-22 Thread Tom Worster

On 4/22/09 10:18 AM, "ldexterldesign"  wrote:

> 
> Hey guys,
> 
> I have 10 separate posts displayed on a page. I want to hide 7 (of the
> oldest) of them and display a link; 'show more posts' - kinda a
> pagination thing I guess.
> 
> My PHP pumps out 10 posts, and I'd like to do the hide/show with JS.
> 
> I'm aware I could simply add and remove a height class, hiding/
> revealing the posts, but I'd like to make it a bit more complex and
> have accurate control over how many posts are shown if my client turns
> around and says he wants 5 posts displayed prior to the button being
> clicked.
> 
> Just thinking about how I might go about this in code I'm thinking of
> doing it the following way. I'm not an excellent programmer, so the
> time you'd, potentially, save me getting it clear in pseudo will most
> likely save me a lot of time this evening. Hell, there might even be a
> plug-in or simpler solution than below you can think of:
> 
> - I get a unique 'post-x' ID for each of the posts, where 'x' is the
> post ID, so I was thinking about just hiding the lowest 7 numeric post
> IDs displayed on the page?
> 
> Thoughts?

say your posts all had class="foopost", could you do something like:

$('.foopost').each(function() {
if ( $(this).attr('id').match(/(\d+)$/)[1] > x ) {
...
}
});




[jQuery] Re: autocomplete

2009-04-21 Thread Tom Worster

On 4/20/09 10:35 PM, "James"  wrote:
 
> Try:
> 
> $("#isearch").autocomplete("search_result.php", {
>  extraParams:{isearch:$("#isearch").val()},
>  width:542,
>  multiple: true,
>  matchContains:true,
>  cacheLength:0,
>  minChars:1,
>  delay:0
> });

i'm not sure that's going to help Pitt. your fragment will execute at page
ready time and set the extra parameter "isearch" for subsequent searches to
whatever the _initial_ value of the field happens to be, quite likely an
empty string.

if you want to send in an extra parameter an element's value at the moment
the query is sent then you can use a function:

$("#isearch").autocomplete("search_result.php", {
 extraParams:{isearch: function() { return $("#isearch").val(); }},
 ...

but in this case it will result in queries with both paraneters "q" and
"isearch" set to the same value, which seems rather pointless.




[jQuery] Re: autocomplete

2009-04-21 Thread Tom Worster

On 4/20/09 10:32 PM, "Pitt Phunsanit"  wrote:

> i found some blobem from autocomplete plugin
> valible isearch don't send to php script

the value of the field is sent in the "q" parameter. write your php script
to use $_GET['q'] instead of $_GET['isearch'].


> 
> $("#isearch").autocomplete("search_result.php?isearch="+$("#isearch").val(),{w
> idth:
> 542,multiple: true,matchContains:true,cacheLength:0,minChars:1,delay:0});
> and if put in event
> $("#isearch").keyup(function(event){
> 
> $("#isearch").autocomplete("search_result.php?isearch="+$("#isearch").val(),{w
> idth:
> 542,multiple: true,matchContains:true,cacheLength:0,minChars:1,delay:0});
> })
> it have mulitple layer
> how to fix it




[jQuery] Re: [autocomplete] Some Problems

2009-04-20 Thread Tom Worster

On 4/19/09 10:17 PM, "HaiLin"  wrote:

> I have some problems about jQuery autoComplete plugin. I use this one:
> http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/.
> Here are problems:
> (1) select in IE6. It seems this can be fixed by using bgiframe
> plugin. Here is the author' optional: bgiframe plugin to fix select-
> problems in IE, just include to apply to autocomplete.
> But, it doesn't work properly. At first, it's ok. But scroll the
> result list, and you will see select on top again.

i can't verify this. could you provide sample markup?


> (2) If you drag the scroll bar of result list, it will not close
> result list when missing focus.

i did verify this. i'd call it a bug.


> (3) If I want to do more things when select one or clear result input
> field, how to do that?

i don't understand.




[jQuery] Re: Autocomplete problems with multiple fields

2009-04-17 Thread Tom Worster

On 4/17/09 12:49 PM, "Lance A. Brown"  wrote:

> 
> Tom Worster wrote:
>> 
>> what autocomplete plugin are you using? this one does not have a documented
>> "parse" option: 
>> http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions
> 
> Its the standard autocomplete plugin available at
> http://docs.jquery.com/Plugins/Autocomplete
> 
> I found the syntax for handling json data in it on another web page.

standard warnings on using undocumented api features apply.




[jQuery] Re: Autocomplete problems with multiple fields

2009-04-17 Thread Tom Worster

On 4/16/09 2:50 PM, "Lance A. Brown"  wrote:

> I'm working on adding autocomplete to a form which describes a
> discussion paper.  Each paper can have multiple authors and I want to
> provide autocomplete on the author names.  I'm new to jQuery so this
> code is kind of rough.
> 
> My java script is:
> 
> // Begin
> function parse_search(data) {
>   var result = [];
>   for (var i = 0; i < data.names.length; i++) {
> result[i] = { data: data.names[i].name,
>   value: data.names[i].id,
>   result: data.names[i].name
> };
>   }
>   return result;
> }
> 
> function  format_item(row, i, max) {
>   return row;
> }
> 
> function set_author_autocomplete()
> {
>   var searchurl = $("#authsearch_url").attr("href");
> 
>   $(".author_name").each(function (i) {
>$(this).autocomplete(searchurl, {
> dataType: 'json',
> parse: parse_search,

what autocomplete plugin are you using? this one does not have a documented
"parse" option: 
http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions


> formatItem: format_item
> }
> )
>  }
>  );
> }
> 
> 
> 
> $(document).ready(set_author_autocomplete);
> //End

two more points, though i don't know if they make any odds:

it seems to be more conventional jq style (see
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery) to put all
your jq script inside  a block like this:

 $(document).ready(function() {  });

and is there a reason to prefer:
  $(".author_name").each(function (i) { $(this).autocomplete(); });
over
  $(".author_name").autocomplete();
?




[jQuery] Re: Validation plugin (bassistance.de) problem

2009-04-17 Thread Tom Worster
i also detected some difference between the demo's behavior and the docs.
i'm not sure what sequence of ui actions led to the result in the attached
png but i've seen it twice now.

On 4/17/09 8:17 AM, "Jörn Zaefferer"  wrote:

> 
> The behaviour is described here:
> http://docs.jquery.com/Plugins/Validation/Reference#Validation_event
> 
> Jörn
> 
> On Fri, Apr 17, 2009 at 10:46 AM, Jonas  wrote:
>> 
>> Example form: http://jquery.bassistance.de/validate/demo/milk/
>> (this is the demo for the script on bassistance.de)
>> 
>> When it does 'live' validation (on blur) it tells the user if the
>> field is correct or incorrect. When you fill in the first field, tab
>> to the next field, go back to the previous (allready filled in) field
>> and clear it, it still counts as valid (notice the icon next to the
>> field).
>> 
>> Since the field is now empty, it should state as invalid, but it
>> doesn't.
>> 
>> This behaviour is random, sometimes it works, sometimes it doesn't.
>> Sometimes it happens in the first field, sometimes on one of the
>> other.
>> 
>>  It only happens before you try to submit the form, after a page
>> submit everything works fine.
>> 
>> Anybody who has a clue?
>> 

<>

[jQuery] Re: [autocomplete] Submit form on click result

2009-04-17 Thread Tom Worster

On 4/17/09 7:14 AM, "dajaniel"  wrote:

> My jquery is pretty sketchy so I was wondering if anybody knew how to
> submit the form that the search field appears in on click of a result
> (after having populated the textfield and any other fields)? Not sure
> how to do this...

check out the documentation for .result() in the autocomplete plugin, then
look at the docs for jquery's .trigger(), here's the links:

http://docs.jquery.com/Plugins/Autocomplete/result#handler
http://docs.jquery.com/Events/trigger#eventdata




[jQuery] Re: Autocomplete plugin for multiple form fields from a JSON source [autocomplete]

2009-04-17 Thread Tom Worster

On 4/16/09 6:44 PM, "tatlar"  wrote:

> So, I got around this by creating another JSON file that is just an
> array of station names. Autocomplete now parses this just fine, and my
> first field is completed. The next part was more tricky - how to
> populate the second input field based on the number of report types (I
> actually ended up using a  element with the  list
> populated with the reports available. My solution is pretty inelegant,
> but uses a nice option in Jorns plugin, the result() option (http://
> docs.jquery.com/Plugins/Autocomplete/result#handler). Using this, I
> can get the match from the first autocomplete call, and write a
> callback function that then goes via AJAX to my original complex JSON
> object to just get the matching stations object.

so in the end you used only a simple autocomplete and circumvented the
issues of handling automatic pre-stuffing of multiple dependent autocomplete
fields with your ajax-stuffed select element.

if it works, it works. since this isn't the kind of solution i'm interested
in, i only briefly read your code to see how you did it. you've avoided
solving the problems i'm interested in.

i have one comment on the code: you embedded an ajax query inside the
.result() handler of an .autocomplete(). this works if users move in one
direction through the form, which, in your case, is from autocompleting text
field to the select. this is something i wanted to avoid; i need a
non-hierarchical ui. the user has three text fields and can start typing in
any of them and then move from there to either of the other two text fields,
and when he or she does, the autocomplete list appears on focus constrained
by the entries already selected.




[jQuery] news headlines

2009-04-16 Thread tom

I have a latest news headline 'box' included on a home page and a
seperate news page with the full stories on.
The news page has a table with a heading newsheadline and i want the
latest news 'box' to just grab the top 5 news headlines from the news
page so i only have to update the news page.  please help!!

if you want to look at code, the pages are www.t-dub.co.uk/WHC/site/index.shtml
(this has the latest news headlines box) and ./news.shtml for the
news page.

Thanks


[jQuery] Re: [Autocomplete] help: keyboard selection not working

2009-04-15 Thread Tom Worster

On 4/15/09 4:21 PM, "Lance Speelmon"  wrote:

> Unfortunately, that did not work for me...  I have tested with both
> Safari4 and FF3.  Any other ideas?  Thanks, L

try using only the style sheet supplied with the plugin. if keyboard nav
works then you can work from that back to your preferred styling
incrementally.




[jQuery] Re: Autocomplete plugin for multiple form fields from a JSON source [autocomplete]

2009-04-15 Thread Tom Worster

i have an ajax backend onto a mysql table with about 25 million rows,
including three searchable indexed text columns. i want a form with three
text input fields, each with autocomplete.

1) if all fields are blank when the user starts to type into one of them
then normal autocomplete happens on that field, independent of the others.

2) but if the user focuses on an empty field after an autocomplete selection
has been made in one or both of the other fields then a list of all distinct
values in that column of the big table, constrained by the selection(s)
already made, is immediately displayed without any typing.

each of the three fields has class 'auto' and there are three blocks like
this one:

$('#field1').autocomplete('suggest.php', {
  extraParams: { 
p: 'field1',
field2: function() { return $('#field2').data('chosen')
? $('#field2').val() : ''; },
field3: function() { return $('#field3').data('chosen')
? $('#field3').val() : ''; } } });

so the back end can figure what's being looked for and what the constraints
are, if any.

to make a list of suggestions display on focus for 2) i have:

var lastfocus = '';
$('.auto').setOptions({ minChars: 2
}).focus(function(){
  if ( lastfocus != $(this).attr('id')
   && $(this).val() == ''
   && ( $('#field').data('chosen')
|| $('#field2').data('chosen')
|| $('#field3').data('chosen') ) )
$(this).data('chosen', false).setOptions(
  {minChars: 0}).trigger('click').trigger('click');
  else
$(this).setOptions({minChars: 2});
  lastfocus = $(this).attr('id');
}).change(function(){
  $(this).data('chosen', false);
  lastfocus = $(this).attr('id');
}).result(function(){
  $(this).data('chosen', true);
});

lastfocus is a hack: the focus event on a field triggers after a selection
is made by clicking. i.e. with mouse selection focus moves to the list and
then back to the text field. lastfocus deals with that.

the 'chosen' data on each field indicates if the value in that field is one
selected from the big table.

two clicks are needed after setting minChars to 0 to display the list of
suggestions. this is a quirk of the plugin.

this is my first version of a script that seems to work in a way that
wouldn't be too surprising to an unprepared user. i haven't given it much
testing yet. comments and improvements would be welcomed.

tom




[jQuery] Re: Autocomplete plugin for multiple form fields from a JSON source [autocomplete]

2009-04-15 Thread Tom Worster

On 4/15/09 2:27 PM, "tatlar"  wrote:

> I am using Jorn's awesome autocomplete plugin in one form field to
> allow a user to quickly narrow down which station they wish to view
> visit times for. However, it would be really cool to extend this so
> that when the selection is narrowed to one station, there is another
> form input field listing all the available visit types that is
> populated from the JSON file as well.

is your question more to do with how to trigger and control the display of
suggestions for the "another form input field" when a selection in the "one
form field" is made? or is it more about using json formatted data?

if the former, i've been working on that recently and could discuss what
i've found.




[jQuery] Re: [autocomplete] charset

2009-04-15 Thread Tom Worster

On 4/15/09 3:19 AM, "borutt"  wrote:


> GET /PHP/data.php?sid=0.179863580913668&q=%C4%8Duk

%C4%8D is the urlencoding of the utf-8 codepoint for 'č'.


> My input was "čuk" but like it's seen from GET params, q param has
> strange chars.
> But in QueryString it is ok.

i don't know what 'QueryString'. if that's an input variable from the query
in your back end script then all is well.


> But when I check param q at the end of request (when it passes value
> to sql) I get value "äťk".

in which case, you have located the problem as being outside of anything to
do with jquery. study your code between input and sql query and/or
reconfigure your interpreter.


> I have set all the header for character set to windows-1250. I think
> that the problem is with ajax request in your script.

it's not my script.


> But I might be wrong.

possibly so.

i use jquery.autocomplete 1.0.2 in a utf-8 environment and it has no problem
handling č or any other character i've tried including hebrew, greek,
arabic, kana, cyrillic and others.

windows-1250 is obsolescent. why not try using utf-8 instead?


> Does this help you any more?

i thought you were the one looking for help.

maybe specify the charset of your javascript as windows-1250:
http://www.capitolacomputing.com/intl_js_charset.htm




[jQuery] Re: assign event handler to multiple events

2009-04-15 Thread Tom Worster

On 4/14/09 6:21 PM, "James"  wrote:

> 
> $('.things').bind('focus change click', function() {
>  // your code here
> });

ah ha! thanks. that is tidy.
tom




[jQuery] assign event handler to multiple events

2009-04-14 Thread Tom Worster

i can assign a handler to one event type thus:

$('.things').focus(function(){
$(this).data('foo', true);
...
});

if i want to assign the same handler to several events, say focus, change,
and click, what's the tidy way to write it [assuming my handler wants to
access $(this)]?




[jQuery] Re: [autocomplete] charset

2009-04-14 Thread Tom Worster

On 4/14/09 11:54 AM, "borutt"  wrote:

> 
>> was the page with the form containing the input element explicitly served
>> with header "Content-Type: text/html; charset=Windows-1250"? (i check
>> headers sent in WebKit Inspector, i'm sure there are other ways.)
> 
> I have included in the html header this line:
> 

that's not necessarily sufficient. if the the server sends, for example,
charset=ISO-8859-1 in the headers then the user agent should ignore the meta
HTTP-EQUIV. read this:

http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#h-5.2.2


>> have you set the accept-charset attribute in the form?
> 
> I have not I never did. Will try this tomorrow.

this has even lower priority than the meta HTTP-EQUIV. if the http header
explicitly sets anything other than windows-1250 then that's what will take
effect in the user agent.


> A assumed that goes something wrong with value after it is submited by
> ajax.
> Because when I receive value from "q" argument it's already scrambled.
> 
> Have any idea?

make sure the header of the form page specifies windows-1250.

check in your server logs to see exactly what the query string was in the
ajax request. compare that with what you receive in the script. if the query
string is correct but the input value in your script is wrong then it's
probably to do with configuration of your script interpreter. if the query
string received in the http server GET request is wrong then the user agent
is probably using the wrong charset.




[jQuery] Re: [autocomplete] charset

2009-04-14 Thread Tom Worster

On 4/14/09 4:36 AM, "borutt"  wrote:

> I'm having problem with charset on searching value, that is returned
> in param "q".
> On main page and od page from where script search for data I have
> charset placed:
> 
> main script:
> 

was the page with the form containing the input element explicitly served
with header "Content-Type: text/html; charset=Windows-1250"? (i check
headers sent in WebKit Inspector, i'm sure there are other ways.)

have you set the accept-charset attribute in the form?

if using php on the back end: have you set php's default_charset config
variable? are you using anything to encode the results sent from the search
script, e.g. htmlspecialchars() -- don't!

if using apache, have you checked that Windows-1250 is loaded as?


> search script:
> header( "Content-Type: text/html; charset=Windows-1250" );

jquery.autocomplete expects plain text back, so "Content-Type: text/plain;
charset=Windows-1250" might work better.


> I get some wierd characters when I use unicode characted like š,č,ž.

those characters appear in Windows-1250 and ISO 8859-2 in addition to
unicode.




[jQuery] Re: [Autocomplete] help: keyboard selection not working

2009-04-13 Thread Tom Worster

i finally figured this out after a lot of trial and error.

for keyboard navigation of the suggestions menus to work you must have a
style rule for the element li.ac_over defined i your css. i was astonished
when i discovered this but after reading the script i think i have a notion
how this can be.

anyway, there it is. put a rule for li.ac_over in your style sheet.


On 4/6/09 6:52 PM, "Tom Worster"  wrote:

> 
> I'm unable to make the keyboard selection of suggestions from the
> dropdown work in my project, otherwise it works fine and selection
> with the mouse is possible.
> 
> I'm using safari 3 and ff3. Keyboard selection in the demos is working
> fine, so this seems not to be a browser issue. I've checked that I
> have the newest jquery.autocomplete.js plugin code. I've checked
> through the API docs and demo code and can't find anything that seems
> to enable or disable keyboard selection. I'm stuck and would be
> grateful for help.
> 
> Here's the markup:
>  www.w3.org/TR/html4/loose.dtd">
> 
> 
> Test new suggest
> 
> 
> 
> 
> 
> 
> 
>   Artist
>p>
>   
> 
> 
> 
> 
> And the script:
> $(document).ready(function() {
> $('#artisttext').autocomplete('suggest-test.php', {extraParams: {p1:
> 'as'} });
> $('.auto').setOptions({minChars: 2, delay: 200, max: 50});
> });




[jQuery] Re: [autocomplete] Regular Expression

2009-04-07 Thread Tom Worster

On 4/7/09 6:26 PM, "Franck Y"  wrote:

> Is there anyway to implement a regular expression feature.
> It does not need to be full regxp butat leat soemthing like star
> 
> *ek will match Creek

if what you're looking for is a substring match as opposed to a begins-with
match then see the matchContains option:

http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions

and compare the first and third demos:

http://view.jquery.com/trunk/plugins/autocomplete/demo/

if using remote search, your backend search code should implement whatever
kind of search you need, which should be compatible with the caching options
you set in autocomplete().




[jQuery] Re: [autocomplete] custom fields for remote URLs

2009-04-07 Thread Tom Worster

On 4/7/09 1:00 PM, "skunkwerk"  wrote:

>i'm using the autocomplete plugin here (http://docs.jquery.com/
> Plugins/Autocomplete) and want to be able to use it with a remote URL,
> while at the same time having access to have text displayed one way,
> and selected another way (ie display a piece of text, but then change
> what is entered into the input box once it's selected)
> 
> with local data you can do this:
> var data = [ {text:'Link A', url:'/page1'}, {text:'Link B', url: '/
> page2'} ];
> formatItem: function(item) {
> return item.text;
>   }
> 
> but how do I do this for a remote URL?  the remote server is supposed
> to return a bunch of matches separated by newline characters, but how
> do I embed multiple fields in the results?

if the value you to enter into the form's input element can be derived
programmatically from the suggested text then you could make the
modification using the formatResult option. there are examples of its use in
the demo: http://view.jquery.com/trunk/plugins/autocomplete/demo/

if the value you want isn't derivable from the suggestions then the simples
answer is probably to make it so. you could put both the suggestion text and
the input value suitably marked up into each line of remote results. then
use formatItem to hide the input value in the suggestion list and use
formatResult to extract it.




[jQuery] [Superfish] CSS Questions

2009-04-07 Thread Tom

I am putting a Superfish menu on my site and I'm having a couple CSS
issues.

First is, can I create separate rollover states for the top level menu
items and the list level menu items?  Right now I can only figure out
how to change the global rollover class, "sfHover".

Second is, my dropdown lists have a width applied to them, but when
they animate downward in IE they don't originally snap to that width,
so after it is fully open it will "hiccup" and then expand to the full
size.

I have a link to share with anyone that can help me, but I'd rather
not publish it here so feel free to email if you can help

Thanks!

Tom


[jQuery] [Autocomplete] One more question

2009-04-07 Thread Tom Worster

There's a "focus grabbing" effect I'm interested in. I can demonstrate using
the demo http://jquery.bassistance.de/autocomplete/demo/ :

1. I type "Ro" into Single Bird (remote), the suggestions appear.

2. But "Ro" is the value I want to enter into the field. So I want to move
focus to another form field. The standard ways to do that are to click on
the field I want to type in next or use (shift-)tab to get there.

3. If I click on the field I want to type in next. e.g. E-Mail (local), it
gets the focus for a moment and then the focus moves back to Single Bird
(remote). That's odd. Same problem with pressing tab or shift-tab. It seems
a field grabs its focus back if I don't use any of its suggestions.

I see the same in FF3 and Safari3. Is this focus grabbing the intended
behavior of Autocomplete?

tom




[jQuery] Re: [autocomplete] How to man ually trigger event for displaying results an d suggestions in Autocomplete by Jörn??

2009-04-07 Thread Tom Worster

On 4/7/09 2:19 AM, "enriquepalaci...@gmail.com" 
wrote:

> My cuestion is about this great autocomplete plugin by Jörn, i got it
> working using ajax and all... But theres no way to display the results
> manually???

i'm interested in this too. i have three form fields, each with
autocompletion queries that depend the values in the other two fields. when
the user chooses from the suggestions for one field, i'd like to
automatically move focus to the next field and display its suggestions with
q='' but constrained by the choice just made for the first field using
extraParams.

triggering some kind of event(s) for the 2nd field from the .result()
handler of the first seems the way to go but i've made no progress.

i read an old thread from this group yesterday that discussed something like
this but i can't find it now.




[jQuery] Autocomplete plugin help: keyboard selection not working

2009-04-06 Thread tom

I'm unable to make the keyboard selection of suggestions from the
dropdown work in my project, otherwise it works fine and selection
with the mouse is possible.

I'm using safari 3 and ff3. Keyboard selection in the demos is working
fine, so this seems not to be a browser issue. I've checked that I
have the newest jquery.autocomplete.js plugin code. I've checked
through the API docs and demo code and can't find anything that seems
to enable or disable keyboard selection. I'm stuck and would be
grateful for help.

Here's the markup:



Test new suggest







  Artist
  
  




And the script:
$(document).ready(function() {
$('#artisttext').autocomplete('suggest-test.php', {extraParams: {p1:
'as'} });
$('.auto').setOptions({minChars: 2, delay: 200, max: 50});
});


[jQuery] Re: loop through div

2009-03-16 Thread Tom Shafer

doesnt seem to work get a recursion error

thanks!
On Mar 16, 7:26 pm, ricardobeat  wrote:
> jQuery.fn.showLoop = function(i){
>   var i = i || 0,
>     self = this;
>   $( this[i] ).show(600, function(){
>        self.showLoop(++i);
>   });
>
> };
>
> $('.type').showLoop();
>
> On Mar 16, 7:27 pm, Tom  Shafer  wrote:
>
> > how can i loop through each div on a page and have them appear one by
> > one
> > i am trying
>
> > var arrayList2 = $.makeArray(document.getElementsByClassName
> > (".type"));
>
> >                                                 
> > $.each(arrayList2,function() {
> >                                                         $(this).show();
> >                                                 });
>
> > thanks
>
> > -tj


[jQuery] Re: loop through div

2009-03-16 Thread Tom Shafer

im getting too much recursion in firebug, any thought?

On Mar 16, 7:26 pm, ricardobeat  wrote:
> jQuery.fn.showLoop = function(i){
>   var i = i || 0,
>     self = this;
>   $( this[i] ).show(600, function(){
>        self.showLoop(++i);
>   });
>
> };
>
> $('.type').showLoop();
>
> On Mar 16, 7:27 pm, Tom  Shafer  wrote:
>
> > how can i loop through each div on a page and have them appear one by
> > one
> > i am trying
>
> > var arrayList2 = $.makeArray(document.getElementsByClassName
> > (".type"));
>
> >                                                 
> > $.each(arrayList2,function() {
> >                                                         $(this).show();
> >                                                 });
>
> > thanks
>
> > -tj


[jQuery] Re: loop through div

2009-03-16 Thread Tom Shafer

thanks guys!

On Mar 16, 7:26 pm, ricardobeat  wrote:
> jQuery.fn.showLoop = function(i){
>   var i = i || 0,
>     self = this;
>   $( this[i] ).show(600, function(){
>        self.showLoop(++i);
>   });
>
> };
>
> $('.type').showLoop();
>
> On Mar 16, 7:27 pm, Tom  Shafer  wrote:
>
> > how can i loop through each div on a page and have them appear one by
> > one
> > i am trying
>
> > var arrayList2 = $.makeArray(document.getElementsByClassName
> > (".type"));
>
> >                                                 
> > $.each(arrayList2,function() {
> >                                                         $(this).show();
> >                                                 });
>
> > thanks
>
> > -tj


[jQuery] loop through div

2009-03-16 Thread Tom Shafer

how can i loop through each div on a page and have them appear one by
one
i am trying

var arrayList2 = $.makeArray(document.getElementsByClassName
(".type"));


$.each(arrayList2,function() {
$(this).show();
});


thanks

-tj


[jQuery] Re: jquery each help

2009-03-15 Thread Tom Shafer

Im getting the effects I want just not in the right order. I think im
going the right way with each, im just not using it the right way. Any
other thoughts?

-TJ

On Mar 15, 4:20 pm, Josh Powell  wrote:
> read up on the .animate() jQuery effect, this might be what you are
> looking for.
>
> http://docs.jquery.com/Effects/animate
>
> On Mar 15, 11:46 am, Tom  Shafer  wrote:
>
> > I have articles in a group of divs
> > 
> >                          > src="media/img/greenBar.png" width="11"
> > height="211"/>
> >                         
> >                                 POSTED: 15 MARCH 
> > 2008 1400 HOURS
> >                                  > SNEAK PREVIEW 
> > OF NO CHILD... > div>
> >                                 Lorem ipsum 
> > dolor sit am
> >                                 >>  > href="#">DOWNLOAD 10% DISCOUNT
> > PASS
> >                                 
> >                         
> > 
> >                          > src="media/img/greenBar.png" width="11"
> > height="211"/>
> >                         
> >                                 POSTED: 15 MARCH 
> > 2008 1400 HOURS
> >                                  > SNEAK PREVIEW 
> > OF NO CHILD... > div>
> >                                 Lorem ipsum 
> > dolor sit amet, conat
> > nulla facilisis.
> >                                 >>  > href="#">DOWNLOAD 10% DISCOUNT
> > PASS
> >                         
> >                         
>
> > I am trying to loop through each class and display them one at a time,
> > article one will display and each class inside article one will show
> > (using the show()) function one at a time. This will happen with each
> > with each article one after another for as many articles as there are.
> > This could be 2 this could be 10. I know this is not a convenient way
> > to load a page but this is what i am trying to do. I am also using a
> > typewriter unction to display letters one at a time.
>
> > I have this right now
> > var arrayList = $.makeArray($('.art').get());
>
> > $.each(arrayList,function() {
> >                                         $(this).show();
> >                                                 
> > $('.postedDate').show().jTypeWriter({onComplete:function(){
> >                                                                 
> > $('.articleHeader').show().jTypeWriter({onComplete:function(){
> >                                                                         
> > $('.articleContent').show().jTypeWriter({onComplete:function()
> > {
> >                                                                         }});
> >                                                                 }});
> >                                                 }});
> >                                         });
>
> > it doesnt quite get it right.
>
> > Here is the sample page
>
> >http://pavlishgroup.com/projects/cpt-test/
>
> > thanks in advance


[jQuery] jquery each help

2009-03-15 Thread Tom Shafer

I have articles in a group of divs



POSTED: 15 MARCH 2008 
1400 HOURS
 > SNEAK PREVIEW OF 
NO CHILD...
Lorem ipsum 
dolor sit am
>> DOWNLOAD 10% DISCOUNT
PASS





POSTED: 15 MARCH 2008 
1400 HOURS
 > SNEAK PREVIEW OF 
NO CHILD...
Lorem ipsum 
dolor sit amet, conat
nulla facilisis.
>> DOWNLOAD 10% DISCOUNT
PASS



I am trying to loop through each class and display them one at a time,
article one will display and each class inside article one will show
(using the show()) function one at a time. This will happen with each
with each article one after another for as many articles as there are.
This could be 2 this could be 10. I know this is not a convenient way
to load a page but this is what i am trying to do. I am also using a
typewriter unction to display letters one at a time.

I have this right now
var arrayList = $.makeArray($('.art').get());

$.each(arrayList,function() {
$(this).show();

$('.postedDate').show().jTypeWriter({onComplete:function(){

$('.articleHeader').show().jTypeWriter({onComplete:function(){

$('.articleContent').show().jTypeWriter({onComplete:function()
{
}});
}});
}});
});

it doesnt quite get it right.

Here is the sample page

http://pavlishgroup.com/projects/cpt-test/

thanks in advance



[jQuery] slowly load image 1 line at a time

2009-03-13 Thread Tom Shafer

hi, I am in need of some way to slowly load a image 1 line at a time,
or maybe load a div 1 line at a time

any ideas?

thanks,
-tom


[jQuery] nsIXMLHttpRequest.open error

2009-03-09 Thread Tom Shafer

I get the error

[Exception... "Component returned failure code: 0x80070057
(NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult:
"0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame ::
http://tjshafer.com/projects/boyd/js/jquery-1.3.2.min.js ::
anonymous :: line 19" data: no]
[Break on this error] (function(){var R=/((?:\((?:\([^()]+\)|[...
(J,typeof K==="string"?K:K+"px")}})})();
Here is the page it is on

http://tjshafer.com/projects/boyd/home.php

click on add new on the left menu, a form will pop open and when you
click next you can see the error in firebug

please let me know what it might be

-thanks,
tj


[jQuery] [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)

2009-03-09 Thread Tom Shafer

what does this error mean

[Exception... "Component returned failure code: 0x80070057
(NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult:
"0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame ::
http://tjshafer.com/projects/boyd/js/jquery-1.3.2.min.js ::
anonymous :: line 19" data: no]

-tj


[jQuery] Form elements able to be deleted by user? [validate]

2009-03-02 Thread tom

I'm using the jquery.validate plugin to validate an email address in a
login form and I have seen a weird bug which I was wondering whether
anyone else has seen / fixed?

I entered a invalid email and the validation error message was show as
normal however, I could delete the error message and also the email
text box! The result was the form was not able to be submitted.
Unfortunately, I was unable to reproduce the problem after seeing it
the once.

Info:
Jquery: 1.3.1
jquery.validate.1.5.1
Browser: IE 7
Relevant code snippet:

// Use JQuery.validator to validate login/registration popup form

$("#f2").validate({

rules: {

txtRemail: {

required: function() {return 
$('#optR').is(':checked');},

email: true

},
},




[jQuery] Re: attr feature

2009-02-09 Thread Tom Shafer

sorry about that

$('#projectid').attr('link')

this is going into ajax post

On Feb 9, 10:59 am, MorningZ  wrote:
> Maybe showing an example of what isn't working would help others help
> you
>
> On Feb 9, 10:28 am, Tom  Shafer  wrote:
>
> > Does the attr feature let me capture my own attribute inside a
> > element. I am trying and it doesnt seem to be working. I just
> > wondering if there was a way to do this.
>
> > Thanks
>
> > -Tom


[jQuery] attr feature

2009-02-09 Thread Tom Shafer

Does the attr feature let me capture my own attribute inside a
element. I am trying and it doesnt seem to be working. I just
wondering if there was a way to do this.

Thanks

-Tom


[jQuery] Re: Text to the left of the jQuery Star Rating Plugin

2009-02-07 Thread Tom

Great, that did the trick on the simplified test version I was messing
around on.  For some reason it didn't work on my site, but I tried
giving it a float: left !important instead and that worked.

Thanks for the help,
Tom

On Feb 7, 4:10 am, jQuery Lover  wrote:
> Surround your text (Rating:) with div and give a float:right CSS...
> worked for me on plugins demo page...
>
> 
> Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com
>
> On Sat, Feb 7, 2009 at 12:54 AM, Tom  wrote:
>
> > Hi, I'm using thestarrating plugin at:
> >http://www.fyneworks.com/jquery/star-rating/
>
> > and I'm trying to add a little text to theleftof a set of stars
> > (i.e. "Rating: * * * * * ").  After fooling around with the CSS for a
> > long time, I still haven't been able to get rid of the line break
> > between the text and the stars (I get the visual equivalent of "Rating:
> > \n* * * * * ").  I've tried floating thingsleft, setting display:
> > inline, etc, but I must be missing something.  I'm using the current
> > version at:
> >http://code.google.com/p/jquery-star-rating-plugin/
>
> > Does anyone know how to do this?
>
> > Much thanks,
> > Tom


[jQuery] Text to the left of the jQuery Star Rating Plugin

2009-02-06 Thread Tom

Hi, I'm using the star rating plugin at:
http://www.fyneworks.com/jquery/star-rating/

and I'm trying to add a little text to the left of a set of stars
(i.e. "Rating: * * * * * ").  After fooling around with the CSS for a
long time, I still haven't been able to get rid of the line break
between the text and the stars (I get the visual equivalent of "Rating:
\n* * * * * ").  I've tried floating things left, setting display:
inline, etc, but I must be missing something.  I'm using the current
version at:
http://code.google.com/p/jquery-star-rating-plugin/

Does anyone know how to do this?

Much thanks,
Tom


[jQuery] Re: jQuery offsetParent - using with drag/drop UI problem in IE7

2009-02-06 Thread tom gee

ah finally i managed to find out what was causing it !!!

not sure if this is something jQuery can even account for really,
unless I guess if jQuery has been used to update the DOM, but its due
to the ossetParent bug with IE, when an element has been updated via
the DOM it throws an unspecified error...!!

http://weblogs.asp.net/rajbk/archive/2006/11/29/ie-6-7-unspecified-error-when-accessing-offsetparent-javascript.aspx

thanks!

On Feb 6, 2:09 pm, tom gee  wrote:
> hi,
>
> apologies the reason i didn't post in the UI group was because it was
> a method of jQuery itself, so I wasn't too sure which group to put it
> in to be honest!
> the thing is im unsure if its a problem with jQuery, I was just hoping
> someone might be able to see if there was a problem with the setup/
> code or if someone had run into the same problem!
>
> using jQuery 1.2.6 with an unkown version of UI as its only the
> minified version with no comments, it would be whicever version is
> compatible with 1.2.6.
>
> thanks,
> tom
>
> On Feb 6, 1:00 pm, "Richard D. Worth"  wrote:
>
> > In the future, please post questions about jQuery UI bugs to the jQuery UI
> > Dev list:
>
> >http://groups.google.com/group/jquery-ui-dev
>
> > The list you've posted to is for general help with jQuery. Also, if you
> > could open a ticket in the jQuery UI bug tracker:
>
> >http://dev.jqueryui.com/newticket(note:registration required)
>
> > Please be sure to provide information about what version of jQuery and
> > jQuery UI you are using. If you can attach a minimal test page that shows
> > the error, that will help even more. Thanks.
>
> > - Richard
>
> > On Fri, Feb 6, 2009 at 7:40 AM, tom gee  wrote:
>
> > > hi all,
>
> > > this problem is driving me nuts! i hope to be able to provide as much
> > > info as possible to help resolve it!! the site is working fine with
> > > the drag n drop, but at some points the drag feature breaks reporting
> > > an error with line number 3370 (or there abouts as i have added a
> > > couple of lines  to try n debug)...the line number points to this line
> > > of code...
>
> > > offsetParent = elem.offsetParent,
>
> > > it reports and error in IE with the script debugger...i have tried
> > > logging the elem to the console and it works fine, but for some reason
> > > it breaks when trying to get the offsetParent and ownerDocument from
> > > the draggable element.
>
> > > any help would be most gratefully appreciated!!! i can supply a URL to
> > > view the issue...the site works fien in FF otherwise i'd be using
> > > firefbug to track down the problem...i can't seem to extract any more
> > > info than this really...!
>
> > > again thanks in advance!!
>
> > > tom


[jQuery] Re: jQuery offsetParent - using with drag/drop UI problem in IE7

2009-02-06 Thread tom gee

hi,

apologies the reason i didn't post in the UI group was because it was
a method of jQuery itself, so I wasn't too sure which group to put it
in to be honest!
the thing is im unsure if its a problem with jQuery, I was just hoping
someone might be able to see if there was a problem with the setup/
code or if someone had run into the same problem!

using jQuery 1.2.6 with an unkown version of UI as its only the
minified version with no comments, it would be whicever version is
compatible with 1.2.6.

thanks,
tom


On Feb 6, 1:00 pm, "Richard D. Worth"  wrote:
> In the future, please post questions about jQuery UI bugs to the jQuery UI
> Dev list:
>
> http://groups.google.com/group/jquery-ui-dev
>
> The list you've posted to is for general help with jQuery. Also, if you
> could open a ticket in the jQuery UI bug tracker:
>
> http://dev.jqueryui.com/newticket(note: registration required)
>
> Please be sure to provide information about what version of jQuery and
> jQuery UI you are using. If you can attach a minimal test page that shows
> the error, that will help even more. Thanks.
>
> - Richard
>
> On Fri, Feb 6, 2009 at 7:40 AM, tom gee  wrote:
>
> > hi all,
>
> > this problem is driving me nuts! i hope to be able to provide as much
> > info as possible to help resolve it!! the site is working fine with
> > the drag n drop, but at some points the drag feature breaks reporting
> > an error with line number 3370 (or there abouts as i have added a
> > couple of lines  to try n debug)...the line number points to this line
> > of code...
>
> > offsetParent = elem.offsetParent,
>
> > it reports and error in IE with the script debugger...i have tried
> > logging the elem to the console and it works fine, but for some reason
> > it breaks when trying to get the offsetParent and ownerDocument from
> > the draggable element.
>
> > any help would be most gratefully appreciated!!! i can supply a URL to
> > view the issue...the site works fien in FF otherwise i'd be using
> > firefbug to track down the problem...i can't seem to extract any more
> > info than this really...!
>
> > again thanks in advance!!
>
> > tom


[jQuery] jQuery offsetParent - using with drag/drop UI problem in IE7

2009-02-06 Thread tom gee

hi all,

this problem is driving me nuts! i hope to be able to provide as much
info as possible to help resolve it!! the site is working fine with
the drag n drop, but at some points the drag feature breaks reporting
an error with line number 3370 (or there abouts as i have added a
couple of lines  to try n debug)...the line number points to this line
of code...

offsetParent = elem.offsetParent,

it reports and error in IE with the script debugger...i have tried
logging the elem to the console and it works fine, but for some reason
it breaks when trying to get the offsetParent and ownerDocument from
the draggable element.

any help would be most gratefully appreciated!!! i can supply a URL to
view the issue...the site works fien in FF otherwise i'd be using
firefbug to track down the problem...i can't seem to extract any more
info than this really...!

again thanks in advance!!

tom


[jQuery] Re: sortable update problem

2009-02-02 Thread Tom Shafer

works perfectly, thank you very much

-Tom

On Feb 2, 12:32 pm, "Richard D. Worth"  wrote:
> jQuery UI 1.5.3 is only compatible with jQuery 1.2.6. In order to use jQuery
> UI with jQuery 1.3+, you'll need the latest preview release1.6rc6. It is
> compatible with 1.3 (but not 1.2.6), and the final release is scheduled for
> tonight. See
>
> http://blog.jquery.com/2009/01/30/jquery-ui-16rc6-help-us-test/
>
> Also note, there is a dedicated mailing list for jQuery UI help:
>
> http://groups.google.com/group/jquery-ui
>
> Thanks.
>
> - Richard
>
> On Mon, Feb 2, 2009 at 11:26 AM, Tom Shafer  wrote:
>
> > I am using sortable and using the update feature to post the order
>
> > $("#2").sortable({
> >                //connectWith: ["#homePage","#acquire","#build"],
> >                items: "li",
> >                opacity: "90",
> >                revert: true,
> >                placeholder: "sortHelper",
> >                activeclass: "sortActive",
> >                hoverclass: "sortHelper",
> >                dropOnEmpty:true,
> >                update: function(element, ui) {
> >                         $.post("addLinks.php",{
> > step:'update',order:$(this).sortable
> > ("serialize")});
> >        }
> >    });
> > it seems that update doesnt work after i upgraded to jquery 1.3.1
> > i also upgraded jquery ui to
> > 1.5.3 as well as sortable
>
> > I can drag and drop and do everything I used to be able to do with
> > 1.2.6. I upgraded to take advantage of the new live function for event
> > delegation
>
> > What could of changed or what I am i missing to make update work
>
> > Thanks
>
> > Tom


[jQuery] Re: sortable update problem

2009-02-02 Thread Tom Shafer



On Feb 2, 12:32 pm, "Richard D. Worth"  wrote:
> jQuery UI 1.5.3 is only compatible with jQuery 1.2.6. In order to use jQuery
> UI with jQuery 1.3+, you'll need the latest preview release1.6rc6. It is
> compatible with 1.3 (but not 1.2.6), and the final release is scheduled for
> tonight. See
>
> http://blog.jquery.com/2009/01/30/jquery-ui-16rc6-help-us-test/
>
> Also note, there is a dedicated mailing list for jQuery UI help:
>
> http://groups.google.com/group/jquery-ui
>
> Thanks.
>

thanks

i appreciate it
> - Richard
>
> On Mon, Feb 2, 2009 at 11:26 AM, Tom Shafer  wrote:
>
> > I am using sortable and using the update feature to post the order
>
> > $("#2").sortable({
> >                //connectWith: ["#homePage","#acquire","#build"],
> >                items: "li",
> >                opacity: "90",
> >                revert: true,
> >                placeholder: "sortHelper",
> >                activeclass: "sortActive",
> >                hoverclass: "sortHelper",
> >                dropOnEmpty:true,
> >                update: function(element, ui) {
> >                         $.post("addLinks.php",{
> > step:'update',order:$(this).sortable
> > ("serialize")});
> >        }
> >    });
> > it seems that update doesnt work after i upgraded to jquery 1.3.1
> > i also upgraded jquery ui to
> > 1.5.3 as well as sortable
>
> > I can drag and drop and do everything I used to be able to do with
> > 1.2.6. I upgraded to take advantage of the new live function for event
> > delegation
>
> > What could of changed or what I am i missing to make update work
>
> > Thanks
>
> > Tom


[jQuery] sortable update problem

2009-02-02 Thread Tom Shafer

I am using sortable and using the update feature to post the order

$("#2").sortable({
//connectWith: ["#homePage","#acquire","#build"],
items: "li",
opacity: "90",
revert: true,
placeholder: "sortHelper",
activeclass: "sortActive",
hoverclass: "sortHelper",
dropOnEmpty:true,
update: function(element, ui) {
 $.post("addLinks.php",{ 
step:'update',order:$(this).sortable
("serialize")});
}
});
it seems that update doesnt work after i upgraded to jquery 1.3.1
i also upgraded jquery ui to
1.5.3 as well as sortable

I can drag and drop and do everything I used to be able to do with
1.2.6. I upgraded to take advantage of the new live function for event
delegation

What could of changed or what I am i missing to make update work

Thanks

Tom


[jQuery] Re: live and plugins

2009-02-01 Thread Tom Shafer

no your right, i have no idea what i was thinking. I got it working

Thanks though

On Feb 1, 9:31 pm, Mike Alsup  wrote:
> > How would I make live work with plugins? With the livequery plugin i
> > used
>
> > $('.text-edit').livequery('click', function() {
> >                 akedit(save_url, options);
>
> >         });
>
> > akedit is a not a jquery function. How would I make a plugin work with
> > this
>
> It should work the same way (unless I misunderstood your question):
>
> $('.text-edit').live('click', function() {
>     akedit(save_url, options);
>
> });


[jQuery] live and plugins

2009-02-01 Thread Tom Shafer

How would I make live work with plugins? With the livequery plugin i
used

$('.text-edit').livequery('click', function() {
akedit(save_url, options);

});

akedit is a not a jquery function. How would I make a plugin work with
this

Thanks,

-Tom


  1   2   3   >