[jQuery] Re: Unsubscribe

2009-09-02 Thread Jonathan Vanherpe (T T NV)


amuhlou wrote:

oh, looks like there's also an Unsubscribe button on that same Edit
my Membership page. Have you tried that?


On Sep 1, 8:52 pm, Peter Stulzer pstul...@mac.com wrote:
Thank you amuhlou. That's what I tried first but I still get all the  
mails. Is there another way to unsubscribe or can some moderator just  
kick me out of all the jQuery groups I'm in right now maybe? Thanks  
for any help.

Peter

Von meinem iPhone gesendet

Am 01.09.2009 um 22:44 schrieb amuhlou amysch...@gmail.com:




On the right side of the page, choose Edit my Membership
There, you will be able to choose the No Email option.
On Sep 1, 4:52 pm, Peter Stulzer pstul...@mac.com wrote:



send an e-mail to jquery-en+unsubscr...@googlegroups.com

--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: Clickable autocomplete, like google

2009-09-02 Thread Jörn Zaefferer

Based on http://plugins.jquery.com/project/autocompletex

$(#search).autocomplete(/searchAutocomplete, {
dataType: json,
parse: function(data) {
return $.map(data, function(row) {
return {
data: row,
value: row.text
}
});
},
formatItem: function(item) {
return item.text;
},
minChars: 1,
selectFirst: false
}).result(function(event, data) {
location.href = data.url;
});

The JSON response looks like this:

[{text:google,url:http://google.com}, {text: other, url:
whatever}]

Jörn

On Tue, Sep 1, 2009 at 11:57 PM, ladksakslingrs...@gmail.com wrote:

 Hello

 I'm looking for an autocomplete that have no submit button, but that
 when the user click on the autocomplete keyword he would be redirected
 to another URL, that i will choose

 i'm using http://dyve.net/jquery/?autocomplete but even the author
 dont know how to make this

 example:

 user type goo
 then appears GOOGLE for him, when he click on GOOGLE the script send
 him to www.google.com

 it would be great if i could just do with the script i told you guys
 i'm not a programmer so i need like, the code itself, i know its too
 much to ask but i tried everything =\

 thank you!



[jQuery] Re: Port Prototype Code to jQuery?

2009-09-02 Thread Jermaine

@Josh Powell: Sure here is the full source in HTML (below you'll find
the Javascript Source written in Prototype)


HTML:

script type=text/javascript
src=http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/
prototype.js/script

script type=text/javascript src=javascript_in_prototype.js/
script

table
tr class=fieldpair
tdinput type=checkbox/
Tennis Ball
/td
td
$input name=price type=text value=5 /
/td
/tr

tr class=fieldpair
tdinput type=checkbox/
Foot Ball
/td
td
$input name=price type=text value=10 /
/td
/tr

tr class=fieldpair
tdinput type=checkbox/
Base Ball
/td
td
$input name=price type=text value=20 /
/td
/tr
/table

pTotal Amount: $ span id=total_amount0/span/p


Javascript_in_prototype.js


// Main calculation function
function calculate() {

var total = 0;

$$(.fieldpair).each(function(fieldpair) {
  if (fieldpair.down(input:checked)) {
 var input = fieldpair.down('input:[name=price]');
 total += parseInt(input.value);
  }
   });

   // Show the result
$(total_amount).update(total);
}


// This is called when the document DOM has
// been fully loaded by the browser.
Event.observe(window, 'load', function() {

   // Do the initial calculation. Some fields might be pre-checked.
   calculate();

   // Attach event handlers for click event on checkboxes
   $$(.fieldpair input:checkbox).each(function(elem) {
  elem.observe('click', calculate);
   });

   // Attach event handlers for keyup event on text fields
   $$(.fieldpair input:textfield).each(function(elem) {
  elem.observe('keyup', calculate);
   });

});


On 1 sep, 21:57, Josh Powell seas...@gmail.com wrote:
 can you send the html too?


[jQuery] Can't assign jQuery jqModal to dynamically added links

2009-09-02 Thread neburton

I've been having problems getting jqmodal modal dialogs to display on
links added dynamically by client side code.  I've demonstrated the
problem at the following URL: http://www.neil-burton.co.uk/jqmodaltest/index.htm

jqModal plugin here - http://dev.iceburg.net/jquery/jqModal/

Any help would be appreciated


[jQuery] Re: Can't assign jQuery jqModal to dynamically added links

2009-09-02 Thread Liam Potter


Use live instead of bind

$(#jqmodalbind).live(click, function(e){
   alert('Binding JQModal');
   $('#addnote').jqm({ajax: '@rel', trigger: '.addnotetrigger'});
});



neburton wrote:

I've been having problems getting jqmodal modal dialogs to display on
links added dynamically by client side code.  I've demonstrated the
problem at the following URL: http://www.neil-burton.co.uk/jqmodaltest/index.htm

jqModal plugin here - http://dev.iceburg.net/jquery/jqModal/

Any help would be appreciated
  




[jQuery] .not($.browser.msie $.browser.version = 7)

2009-09-02 Thread IschaGast

I am having rounded corners in a site but I don't want them in IE
because it does strange things with the corners.

Something like below isn't that possible?
.corners(4px).not($.browser.msie  $.browser.version = 7)

What are the other solution to only target IE for not rounding that
corners?

Gr Ischa


[jQuery] RE: Newbie: Cannot get .text() to work with IE7

2009-09-02 Thread Knight, Doug
All,
I wasn't sure if this got lost in the shuffle of my first post. Does anyone 
know why the following works under FF and not under IE7? There are comments 
within the code to explain what I'm seeing. Sorry, I don't have an external 
facing website on which to post this.

Doug


From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of Knight, Doug
Sent: Monday, August 31, 2009 2:35 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Newbie: Cannot get .text() to work with IE7

All,
I'm new to jQuery, but not JavaScript. I have the following really simple html 
file with jQuery-based JavaScript to open, read and display part of an xml 
file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing 
something really simple to make jQuery work on IE7? Any help would be great, 
thanks!

Doug Knight

Here's the html/JavaScript:

html
head
titleRead XML/title
script src=lib/jquery.js 
type=text/javascript charset=utf-8/script
script type=text/javascript charset=utf-8
jQuery(function(){
//$(document).ready(function(){


jQuery.get(test.xml,{},function(xml){

//$.get(test.xml,{},function(xml){

DBArea = '';
// This 
displays the values from the XML file
DBArea += xml 
= : + xml + :\n;
// I get blanks 
here
DBArea += 
$(xml).text() = : + $(xml).text() + :\n;
// The 
following gives [Object Object]
ph_sites = 
$(xml).find('product_header_sites');
DBArea += 
ph_sites = : + ph_sites + :\n;
// And the 
following gives blanks too
ph_sites = 
$(xml).find('product_header_sites').text();
DBArea += 
ph_sites = : + ph_sites + :\n;

// Update the 
DIV called Content Area with the HTML string

$(#DebugArea).append(pre + DBArea + /pre);
});
});
/script
/head
body
div id=DebugArea/div
/body
/html

And here's the XML file:

text_msg
product_header
product_header_site_id255/product_header_site_id
product_header_node191/product_header_node
product_header_byte_count332/product_header_byte_count
product_header_product_type2/product_header_product_type
product_header_product_status0/product_header_product_status
product_header_sitesF90/product_header_sites
/product_header
/text_msg




[jQuery] abeautifulsite.net plugins : tree view and context menu together

2009-09-02 Thread Julien

Hi,

I'd like to put context menu ( http://abeautifulsite.net/notebook.php?article=80
) on each tree view item ( http://abeautifulsite.net/notebook.php?article=58
)

The tree have many sub directories, sub sub directories, etc... and
files.

I need the id of the selected item (directory or file), and I don't
know how to get it.

Someone did it before ? Any help is very, very much appreciated.


[jQuery] Ajax chaining

2009-09-02 Thread erikms

Hi all,
I have a page that I want to use to display updates coming from the
server.
In my innocence, I assumed that the following code:

function get_status(response){
$(#selector).text(response);
$.ajax({
type: GET,
url: server url,
success: get_status(response)
});
}

and server side something that sends a response, would give me
successive ajax calls, made visible in the page via #selector.
However, this does not happen. response comes back as an empty string,
even though I can test the url and it gives me data (time() in this
case, just for testing).
What am I doing wrong here? Is AJAX reciursion evil?
Cheers,

-Erik


[jQuery] Animated window scroll with jquery

2009-09-02 Thread Alaa

Hi all,

Here is something cool... jQuery window scroll with animation

http://blog.freelancer-id.com/index.php/2009/03/26/scroll-window-smoothly-in-jquery


[jQuery] Accessing Elements after adding them with Append

2009-09-02 Thread Daniel

Hi There,

I'm having trouble accessing some Elements with jQuery after I created
them and added them to the HTML. I want to add some Checkboxes to my
Site as soon as the user clicks another Checkbox. That works just
fine. But if the user clicks on one of these added checkboxes, i want
an event to trigger, too. For starters, i just want to alert a
message. But this doesnt happen.

Here's my code:

function load(katstring) {
var mykats = '';
$('div#kategorien input:checkbox:checked').each(function() {
mykats += mykategorien[]= + $(this).attr('id').substr(4);
});
$.post('ajaxfunctions.php', 'function=updateCategories', function
(data){
var kattext = '';
kattext += 'ul';
for (index in data) {
kattext += 'liinput type=checkbox name=category[]
value='+data[index]+' /'+data[index]+'/li';
}
kattext += '/ul';

$('div#categories div.select').html(kattext);
},'json');
}

$('div#categories div.select ul li input').click( function() {
alert(clicked);
});

So on click of the new, added checkboxes, i want to alert clicked.
Nothing More. But that just won't happen. First, i figured the problem
lies in just adding some html Text and not properly adding the
elements to the DOM Tree. So i tried something like this:

function load(katstring) {
var mykats = '';
$('div#kategorien input:checkbox:checked').each(function() {
mykats += mykategorien[]= + $(this).attr('id').substr(4);
});
$.post('ajaxfunctions.php', 'function=updateCategories', function
(data){
var cul = document.createElement('ul');
for (index in data) {
var cli = document.createElement('li');
var cinput = document.createElement('input');
var ctext = document.createTextNode(data[index]);
cli.appendChild(cinput);
cli.appendChild(ctext);
cul.appendChild(cli);
}
document.getElementById('categories').appendChild(cul);
},'json');
}

$('div#categories ul li input').click( function() {
alert(clicked);
});

In this Code all the Element Attributes are missing but I think you
get what i was trying. ;) So, now I think the Elements are added
properly to DOM tree. But still, when I click on one of the added
input Elements, nothing happens.

What am I doing wrong? How can i get jQuery to recognize the Elements
I added?

Can you please help? Thanks a lot.

battlewizz


[jQuery] Help with Required( dependency-callback )

2009-09-02 Thread HDflat

http://docs.jquery.com/Plugins/Validation/Methods/required

I am trying to implement the bottom option into my website, and i
think this is the option i want.

Im trying to get an either or validation, that one or the other is
required.

I think this one can do it, but is there a way instead of

return $(#age).val()  13;

that it can check length?

or someway to do my original need would be great :)

thanks and sorry if i posted this in wrong section im in a rush


[jQuery] Re: .not($.browser.msie $.browser.version = 7)

2009-09-02 Thread MorningZ

I have zero idea if this actually works, but maybe conditional
comments would work?

!--[if lt IE 8]
script type=text/javascript
 //stuff you would only do in IE8 and other browsers
/script
![endif]--

On Sep 2, 7:20 am, IschaGast cont...@ischagast.nl wrote:
 I am having rounded corners in a site but I don't want them in IE
 because it does strange things with the corners.

 Something like below isn't that possible?
 .corners(4px).not($.browser.msie  $.browser.version = 7)

 What are the other solution to only target IE for not rounding that
 corners?

 Gr Ischa


[jQuery] Re: .not($.browser.msie $.browser.version = 7)

2009-09-02 Thread Liam Potter


if ( !$.browser.msie  !$.browser.version = 7 ) {
$(div).corners(4px);
}

though the $.browser.msie will block any ie browser, so the bit making sure 
it is under version 7 is redundant.



IschaGast wrote:

I am having rounded corners in a site but I don't want them in IE
because it does strange things with the corners.

Something like below isn't that possible?
.corners(4px).not($.browser.msie  $.browser.version = 7)

What are the other solution to only target IE for not rounding that
corners?

Gr Ischa
  




[jQuery] Re: .not($.browser.msie $.browser.version = 7)

2009-09-02 Thread MorningZ

Ah damn, i have that all wrong. it's backwards, sorry about that

but maybe that would provide an alternative direction none the less

http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx


On Sep 2, 7:57 am, MorningZ morni...@gmail.com wrote:
 I have zero idea if this actually works, but maybe conditional
 comments would work?

 !--[if lt IE 8]
 script type=text/javascript
      //stuff you would only do in IE8 and other browsers
 /script
 ![endif]--

 On Sep 2, 7:20 am, IschaGast cont...@ischagast.nl wrote:

  I am having rounded corners in a site but I don't want them in IE
  because it does strange things with the corners.

  Something like below isn't that possible?
  .corners(4px).not($.browser.msie  $.browser.version = 7)

  What are the other solution to only target IE for not rounding that
  corners?

  Gr Ischa


[jQuery] [Superfish] IE7 and below errors (just information)

2009-09-02 Thread theosoft

This is something I discovered when implementing Superfish on our
recently redesigned site at http://www.ciu.edu.

We have navigation menus that are edited by content editors as html
files. Our PHP files will include that html file if it exists.
However, the WYSIWYG editor (XStandard in this case) inserts a HTML
comment at the top of each file.

When this file is included on a page that has a Submission form (in
our case, a Preview Days registration form), and it is part of a
submenu, it throws an error in IE. In IE8 (and compatibility mode of
IE8), it degrades gracefully and shows a javascript error icon in the
lower left corner. On IE7 and below, it pops up a javascript dialog
box and sends the user away from the page, disallowing them to fill in
the form.

The error message talks of a HTML Parsing Error.

I've traced the error message to a Knowledge Base article from
Microsoft, in which it basically indicates that you have unclosed tags
(which I did not). Then I traced the error to the comment being
inserted by the WYSIWYG and found that if the HTML comment is past a
certain amount of characters, then the insertion of the arrows by
Superfish throws the IE error.

I was able to solve my problem by just removing the HTML comment and
the error went away. However, future edits on these navigation files
will probably add the comment back in, over which I have no control
over, with the exception of possibly writing a php or javascript
script to look for the comment and manually remove it.

I'm really just posting this as information for anyone who may run
into a similar error. Maybe there's a solution within Superfish on
this. I have not examined the code yet to see, but just wanted to put
the information out there that this is a known bug in Internet
Explorer and how to not cause the bug to happen.


[jQuery] Re: Newbie: Cannot get .text() to work with IE7

2009-09-02 Thread Leonardo K
Maybe its a problem with you xml:

*product_header_sites*F90/*product_header_itws_sites*


On Wed, Sep 2, 2009 at 08:53, Knight, Doug dkni...@mitre.org wrote:

  All,

 I wasn’t sure if this got lost in the shuffle of my first post. Does anyone
 know why the following works under FF and not under IE7? There are comments
 within the code to explain what I’m seeing. Sorry, I don’t have an external
 facing website on which to post this.



 Doug





 *From:* jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] *On
 Behalf Of *Knight, Doug
 *Sent:* Monday, August 31, 2009 2:35 PM
 *To:* jquery-en@googlegroups.com
 *Subject:* [jQuery] Newbie: Cannot get .text() to work with IE7



 All,

 I’m new to jQuery, but not JavaScript. I have the following really simple
 html file with jQuery-based JavaScript to open, read and display part of an
 xml file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing
 something really simple to make jQuery work on IE7? Any help would be great,
 thanks!



 Doug Knight



 Here’s the html/JavaScript:



 html

 head

 titleRead XML/title

 script src=lib/jquery.js
 type=text/javascript charset=utf-8/script

 script type=text/javascript
 charset=utf-8

 jQuery(function(){

 //$(document).ready(function(){




 jQuery.get(test.xml,{},function(xml){


 //$.get(test.xml,{},function(xml){



 DBArea =
 '';

 // This
 displays the values from the XML file

 DBArea +=
 xml = : + xml + :\n;

 // I get
 blanks here

 DBArea +=
 $(xml).text() = : + $(xml).text() + :\n;

 // The
 following gives [Object Object]

 ph_sites =
 $(xml).find('product_header_sites');

 DBArea +=
 ph_sites = : + ph_sites + :\n;

 // And the
 following gives blanks too

 ph_sites =
 $(xml).find('product_header_sites').text();

 DBArea +=
 ph_sites = : + ph_sites + :\n;



 // Update
 the DIV called Content Area with the HTML string


 $(#DebugArea).append(pre + DBArea + /pre);

 });

 });

 /script

 /head

 body

 div id=DebugArea/div

 /body

 /html



 And here’s the XML file:



 text_msg

 product_header

 product_header_site_id255/product_header_site_id

 product_header_node191/product_header_node

 product_header_byte_count332/product_header_byte_count

 product_header_product_type2/product_header_product_type


 product_header_product_status0/product_header_product_status

 product_header_sitesF90/product_header_sites

 /product_header

 /text_msg







[jQuery] Re: Howto: replace the current webpage with content from another webpage.

2009-09-02 Thread lihao

On Sep 1, 7:26 pm, Mike Alsup mal...@gmail.com wrote:
  I am trying to define an onclick event to a form button, so that
  when I click this button, content from another webpage will overwrite
  this page (not open a new webpage). I've tried the below code (sample)
  which is not working.

  form action=/script method=post
    ..other elements../
    input type=button name=jump value=Jump /
  /form

  script type=text/javascript
   $(':button[name=jump]').click(function() {
       $(document).load('/path/to/another_page.html');
   });
  /script

 To cause the browser to navigate to a different page, set the 'href'
 property of the window.location object:

 window.location.href = '/path/to/another_page.html';


worked, thank you very much. :-)

lihao

 https://developer.mozilla.org/en/DOM/window.location


[jQuery] Re: Accessing Elements after adding them with Append

2009-09-02 Thread rupak mandal
hi daniel,

You have to bind click function after the element was append to DOM. But
there is a problem Jquery support multiple binding. So you have to first
unbind the click function, then append an element to the DOM and then bind
click function. I think this code will help you -:

$(div#categories ul li input).unbind('click',alertfunction);

//append element

$(div#categories ul li input).bind('click',alertfunction);



function alertfunction()
{
 alert(clicked);
}


Thanks
Rupak

On Wed, Sep 2, 2009 at 2:21 PM, Daniel battlew...@googlemail.com wrote:


 Hi There,

 I'm having trouble accessing some Elements with jQuery after I created
 them and added them to the HTML. I want to add some Checkboxes to my
 Site as soon as the user clicks another Checkbox. That works just
 fine. But if the user clicks on one of these added checkboxes, i want
 an event to trigger, too. For starters, i just want to alert a
 message. But this doesnt happen.

 Here's my code:

 function load(katstring) {
var mykats = '';
$('div#kategorien input:checkbox:checked').each(function() {
mykats += mykategorien[]= + $(this).attr('id').substr(4);
});
$.post('ajaxfunctions.php', 'function=updateCategories', function
 (data){
var kattext = '';
kattext += 'ul';
for (index in data) {
kattext += 'liinput type=checkbox
 name=category[]
 value='+data[index]+' /'+data[index]+'/li';
}
kattext += '/ul';

$('div#categories div.select').html(kattext);
},'json');
 }

 $('div#categories div.select ul li input').click( function() {
alert(clicked);
 });

 So on click of the new, added checkboxes, i want to alert clicked.
 Nothing More. But that just won't happen. First, i figured the problem
 lies in just adding some html Text and not properly adding the
 elements to the DOM Tree. So i tried something like this:

 function load(katstring) {
var mykats = '';
$('div#kategorien input:checkbox:checked').each(function() {
mykats += mykategorien[]= + $(this).attr('id').substr(4);
});
$.post('ajaxfunctions.php', 'function=updateCategories', function
 (data){
var cul = document.createElement('ul');
for (index in data) {
var cli = document.createElement('li');
var cinput = document.createElement('input');
var ctext = document.createTextNode(data[index]);
cli.appendChild(cinput);
cli.appendChild(ctext);
cul.appendChild(cli);
}
document.getElementById('categories').appendChild(cul);
},'json');
 }

 $('div#categories ul li input').click( function() {
alert(clicked);
 });

 In this Code all the Element Attributes are missing but I think you
 get what i was trying. ;) So, now I think the Elements are added
 properly to DOM tree. But still, when I click on one of the added
 input Elements, nothing happens.

 What am I doing wrong? How can i get jQuery to recognize the Elements
 I added?

 Can you please help? Thanks a lot.

 battlewizz



[jQuery] Re: Joining values in ajax load

2009-09-02 Thread robert...@gmail.com

I was trying to simplify my question and consequently may have not
asked it correctly.

Here it the revised question:

1. I have a from inside a repeat region ,  I append the id with the
record index for identification purposes.  I also have my display div
inside the repeat region.
''
form 
input name=CustNum2 type=hidden id=CustNum2%=Repeat1__index%
value=%=request.Querystring(CustNum)% /
input name=PartNum2 type=text id=PartNum2%=Repeat1__index%
value=%=rsSpecials.Fields.Item(SKU).Value% /
input type=button value=%=rsSpecials.Fields.Item
(Program_Type).Value% class=mybutton   /
  /form

div id=showtime2%=Repeat1__index%nbsp;/div
'''

2. Then I have my Jquery script:


$(document).ready(function() {

$('.mybutton').click(function(event) {
var request=$(this).attr('id');
$(#showtime2+request).load(Test.asp?CustNum=+$
('#CustNum2'+request).val()+PartNum=+$('#PartNum2'+request).val());
});
});
'''
I get no response at all

THANKS FOR THE HELP

On Sep 1, 9:55 pm, James james.gp@gmail.com wrote:
 The code looks correct as far as I can see. You're going to have to
 provide some HTML of your #CustNum and #PartNum.

 On Sep 1, 2:54 pm, robert...@gmail.com robert...@gmail.com wrote:



  Newbie here - Whenever I try to join variables I get results for first
  item (CustNum) only...PartNum returns as 'undefined'.

  Can someone tell me the problem with this code:

  $(document).ready(function() {
  $(.mybutton).click(function(event) {
  $(#myDiv).load(Test.asp?CustNum=+ $('#CustNum').val() +PartNum=
  + $('#PartNum').val());

  });
  });- Hide quoted text -

 - Show quoted text -


[jQuery] [Superfish] Background fade of menus

2009-09-02 Thread theosoft

I'm not sure what's going on with the background fade of the my
dropdowns and flyouts.

When I mouseout, the background disappears, but the text remains.
What's going on with that?

You can view it at http://www.ciu.edu.

Thank you,
Chris Coppenbarger


[jQuery] Re: Check if function exists

2009-09-02 Thread MorningZ

you should be able to wrap that call in

if (jQuery.tinymce) {
   ...   your code doing tinymce stuff ...
}

On Sep 2, 10:44 am, shapper mdmo...@gmail.com wrote:
 Hello,

 I am loading TinyMCE using the new JQuery Plugin:

 script type=text/javascript
   $().ready(function() {
      $('textarea.tinymce').tinymce({
        // Location of TinyMCE script
          script_url : '../js/tinymce/jscripts/tiny_mce/tiny_mce.js',

 Is there a way to load only if tinymce plugin is present without
 getting an error?

 Basically if I don't want to load the tinymce I just don't load the
 plugin ...
 ... Because I am not able to pass, I think, to my SiteScript.JS file
 if I want to load or not the plugin.

 Thanks,
 Miguel


[jQuery] Re: Form built by ajax doesn't submit

2009-09-02 Thread Reynolds Design Studio

that worked!

thanks mike

On Sep 1, 6:22 pm, Mike Alsup mal...@gmail.com wrote:
  what i get back from ajax looks exactly the same as the form above
  just with updated values.

 Instead of doing this:

 $(.button).click(function() {  ...

 do this:

 $(.button).live('click', function() {  ...

 http://docs.jquery.com/Events/live


[jQuery] use an external js file for validation of many forms

2009-09-02 Thread kathb4

I want to use an external js file for validation of many forms - all
of which have items in common, like start_date. I want it to be re-
usable from application to application.

Using the groups I have found that I can do this by having something
like
[code]
$(.sharedClassName).each.function() {
  $(this).validate({
rules: {
  sampling_date: {
required:   true
   , date:   true
  }
},
messages: {
 sampling_date: Please enter the date you collected your sample
in the format dd/mm/.
 }
  });
});
[/code]

BUT I also then want to create validations separately per form using
the rules.add format but I can't seem to make it work. Any ideas where
I am wrong?
[code]
$(input[name^='occurrencer']).rules(add, {
required:true,
messages: {
required: You must enter a name
}
});
[/code]

Thanks

K


[jQuery] Check if function exists

2009-09-02 Thread shapper

Hello,

I am loading TinyMCE using the new JQuery Plugin:

script type=text/javascript
  $().ready(function() {
 $('textarea.tinymce').tinymce({
   // Location of TinyMCE script
 script_url : '../js/tinymce/jscripts/tiny_mce/tiny_mce.js',

Is there a way to load only if tinymce plugin is present without
getting an error?

Basically if I don't want to load the tinymce I just don't load the
plugin ...
... Because I am not able to pass, I think, to my SiteScript.JS file
if I want to load or not the plugin.

Thanks,
Miguel


[jQuery] Re: $ajax() question

2009-09-02 Thread Dave Ward

It may be too late, but I would recommend avoiding a call to an ASPX
page like that.  Even though you're not using it, the entire ASP.NET
WebForms Page class is instantiated for any call to an ASPX page,
which has significant overhead.

An ASMX web service or ASHX handler would be much better choices.

If you have ASP.NET AJAX installed on 2.0 or are using 3.5+, ASMX
services even automate the JSON (de)serialization process.

See this post for a basic example of that:
http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/

And a more complex example:
http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/

On Aug 10, 6:41 pm, yi falconh...@gmail.com wrote:
 $.ajax({

                                         type: POST,

                                         url: mywebpage.aspx?
 Arg=+args2,

                                         contentType: text,

                                         data:{},

                                         dataType: text,

                                         success: CompleteInsert,

                                         error: onFail

                                 });

 I dont know why the onFail function is going to be executed when args2
 is too big.
 args2 is a string type
 can anyone explain this
 thanks


[jQuery] Re: Joining values in ajax load

2009-09-02 Thread robert...@gmail.com

Resolved...The issue was the recordset query ...the Jquery code was ok
afterall.
My lesson learned is to find a better way to test errors ...
Thx

On Sep 2, 9:26 am, robert...@gmail.com robert...@gmail.com wrote:
 I was trying to simplify my question and consequently may have not
 asked it correctly.

 Here it the revised question:

 1. I have a from inside a repeat region ,  I append the id with the
 record index for identification purposes.  I also have my display div
 inside the repeat region.
 ''
 form 
 input name=CustNum2 type=hidden id=CustNum2%=Repeat1__index%
 value=%=request.Querystring(CustNum)% /
 input name=PartNum2 type=text id=PartNum2%=Repeat1__index%
 value=%=rsSpecials.Fields.Item(SKU).Value% /
 input type=button value=%=rsSpecials.Fields.Item
 (Program_Type).Value% class=mybutton   /
       /form

 div id=showtime2%=Repeat1__index%nbsp;/div
 '''

 2. Then I have my Jquery script:

 
 $(document).ready(function() {

 $('.mybutton').click(function(event) {
 var request=$(this).attr('id');
 $(#showtime2+request).load(Test.asp?CustNum=+$
 ('#CustNum2'+request).val()+PartNum=+$('#PartNum2'+request).val());});
 });

 '''
 I get no response at all

 THANKS FOR THE HELP

 On Sep 1, 9:55 pm, James james.gp@gmail.com wrote:



  The code looks correct as far as I can see. You're going to have to
  provide some HTML of your #CustNum and #PartNum.

  On Sep 1, 2:54 pm, robert...@gmail.com robert...@gmail.com wrote:

   Newbie here - Whenever I try to join variables I get results for first
   item (CustNum) only...PartNum returns as 'undefined'.

   Can someone tell me the problem with this code:

   $(document).ready(function() {
   $(.mybutton).click(function(event) {
   $(#myDiv).load(Test.asp?CustNum=+ $('#CustNum').val() +PartNum=
   + $('#PartNum').val());

   });
   });- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: [Superfish] Background fade of menus

2009-09-02 Thread Charlie





appears you used CSS for another menu system.(
Author: Craig Erskine Description: Dynamic Menu System)
Rules for hovers aren't working with script. If you want to use the
script use the CSS also. There are classes like sfHover that get added
on show that you aren't accounting for in the other CSS

theosoft wrote:

  I'm not sure what's going on with the background fade of the my
dropdowns and flyouts.

When I mouseout, the background disappears, but the text remains.
What's going on with that?

You can view it at http://www.ciu.edu.

Thank you,
Chris Coppenbarger

  






[jQuery] Re: Check if function exists

2009-09-02 Thread Michael Lawson
if(functioname)
{
 //it exists, do stuff
}
cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'



   
  From:   shapper mdmo...@gmail.com   
   

   
  To: jQuery (English) jquery-en@googlegroups.com   
   

   
  Date:   09/02/2009 11:28 AM   
   

   
  Subject:[jQuery] Check if function exists 
   

   






Hello,

I am loading TinyMCE using the new JQuery Plugin:

script type=text/javascript
  $().ready(function() {
 $('textarea.tinymce').tinymce({
   // Location of TinyMCE script
 script_url : '../js/tinymce/jscripts/tiny_mce/tiny_mce.js',

Is there a way to load only if tinymce plugin is present without
getting an error?

Basically if I don't want to load the tinymce I just don't load the
plugin ...
... Because I am not able to pass, I think, to my SiteScript.JS file
if I want to load or not the plugin.

Thanks,
Miguel

inline: graycol.gifinline: ecblank.gif

[jQuery] Re: Email obfuscator/defuscator plugin

2009-09-02 Thread shapper

I found the following one:

http://plugins.jquery.com/project/RotationalStringObfuscator

It seems interesting.

How can I apply it to all emails on my web page?

Thank You,
Miguel


[jQuery] Email obfuscator/defuscator plugin

2009-09-02 Thread shapper

Hello,

Could someone recommend me a good email obfuscator/defuscator plugin?

Thanks,
Miguel


[jQuery] Re: Check if function exists

2009-09-02 Thread Michael Geary
You could try to test for the existence of a global function that way, but
it wouldn't work. It would give you a reference error on 'functionname' if
it isn't defined.
 
For a global function you would use:
 
if( window.functionname ) {
...
}
 
But Miguel's question wasn't about global functions, it was about the
tinymce plugin. He wants to find out if the $(...).tinymce() method exists
before calling it. Since jQuery plugin methods are properties of $.prototype
(aka $.fn), this will work:
 
if( $.fn.tinymce ) {
$(...).tinymce({
...
});
}
 
-Mike



  _  

From: Michael Lawson

if(functioname)
{
//it exists, do stuff
}
cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone: 1-276-206-8393 
E-mail: mjlaw...@us.ibm.com 

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..' 

Inactive hide details for shapper ---09/02/2009 11:28:17 AM---Hello,shapper
---09/02/2009 11:28:17 AM---Hello,




From:
shapper mdmo...@gmail.com 

To:  
jQuery (English) jquery-en@googlegroups.com 

Date:
09/02/2009 11:28 AM 

Subject: 
[jQuery] Check if function exists   
  _  





Hello,

I am loading TinyMCE using the new JQuery Plugin:

script type=text/javascript
 $().ready(function() {
$('textarea.tinymce').tinymce({
  // Location of TinyMCE script
script_url : '../js/tinymce/jscripts/tiny_mce/tiny_mce.js',

Is there a way to load only if tinymce plugin is present without
getting an error?

Basically if I don't want to load the tinymce I just don't load the
plugin ...
... Because I am not able to pass, I think, to my SiteScript.JS file
if I want to load or not the plugin.

Thanks,
Miguel




graycol.gifecblank.gif

[jQuery] Re: Accessing Elements after adding them with Append

2009-09-02 Thread mkmanning

Use .live()

http://docs.jquery.com/Events/live#typefn


On Sep 2, 1:51 am, Daniel battlew...@googlemail.com wrote:
 Hi There,

 I'm having trouble accessing some Elements with jQuery after I created
 them and added them to the HTML. I want to add some Checkboxes to my
 Site as soon as the user clicks another Checkbox. That works just
 fine. But if the user clicks on one of these added checkboxes, i want
 an event to trigger, too. For starters, i just want to alert a
 message. But this doesnt happen.

 Here's my code:

 function load(katstring) {
         var mykats = '';
         $('div#kategorien input:checkbox:checked').each(function() {
                 mykats += mykategorien[]= + $(this).attr('id').substr(4);
         });
         $.post('ajaxfunctions.php', 'function=updateCategories', function
 (data){
                 var kattext = '';
                 kattext += 'ul';
                 for (index in data) {
                         kattext += 'liinput type=checkbox 
 name=category[]
 value='+data[index]+' /'+data[index]+'/li';
                 }
                 kattext += '/ul';

                 $('div#categories div.select').html(kattext);
         },'json');

 }

 $('div#categories div.select ul li input').click( function() {
         alert(clicked);

 });

 So on click of the new, added checkboxes, i want to alert clicked.
 Nothing More. But that just won't happen. First, i figured the problem
 lies in just adding some html Text and not properly adding the
 elements to the DOM Tree. So i tried something like this:

 function load(katstring) {
         var mykats = '';
         $('div#kategorien input:checkbox:checked').each(function() {
                 mykats += mykategorien[]= + $(this).attr('id').substr(4);
         });
         $.post('ajaxfunctions.php', 'function=updateCategories', function
 (data){
                 var cul = document.createElement('ul');
                 for (index in data) {
                         var cli = document.createElement('li');
                         var cinput = document.createElement('input');
                         var ctext = document.createTextNode(data[index]);
                         cli.appendChild(cinput);
                         cli.appendChild(ctext);
                         cul.appendChild(cli);
                 }
                 document.getElementById('categories').appendChild(cul);
         },'json');

 }

 $('div#categories ul li input').click( function() {
         alert(clicked);

 });

 In this Code all the Element Attributes are missing but I think you
 get what i was trying. ;) So, now I think the Elements are added
 properly to DOM tree. But still, when I click on one of the added
 input Elements, nothing happens.

 What am I doing wrong? How can i get jQuery to recognize the Elements
 I added?

 Can you please help? Thanks a lot.

 battlewizz


[jQuery] Problems with minDate on datepicker not allowing before 1999.

2009-09-02 Thread hoe``

If I do something like, minDate: new Date(1930, 1-1, 14)
or, minDate: '-70Y'

The oldest date available will be 1999, and no matter what I've tried
I've never been able to get beyond this barrier. Is this a limitation
of datepicker?

Thank you,
~Joe


[jQuery] JQuery Form - Ajax - Please HELP ! ! ! ! ! ! !

2009-09-02 Thread huntspointer2009

///Comment:
Can someone help me do the following:
create a function that collects ALL of the form's text field's Values,
along with their corresponding ID, and create an Array like this:
Example: var dataString = (item_01=123, item_01=456, item_01=789)

then take the 'dataString' Array, and send it to a Server via Ajax,
whenever I click the 'Submit Button'

Please Note:
that as new items are created/added to the form,
the 'Submit Button' must be able to continue submitting the
'dataString' Array to server via Ajax
whenever I click it.


// HTML Code :
form id=myForm action=receive_items.php method=post
ul
li
labelItem_01/label
input type=text id=item_01 class=item_field
value=123/
input type=submit value=delete button
class=button_delete/
/li
li
labelItem_02/label
input type=text id=item_02 class=item_field
value=456/
input type=submit value=delete button
class=button_delete/
/li
li id=item_03
labelItem_03/label
input type=text id=item_03 class=item_field
value=789/
input type=submit value=delete button
class=button_delete/
/li
/ul
input type=submit value=Submit Button class=button_submit/
/form


// JQuery Code:
$(document).ready(function(){
$('.button_submit').click(function(){
$.ajax({
type: POST,
url: receive_items.php,
data: dataString,
success: function(){
alert(The Data was successfully sent to 
server:);
}
});
});
});

- Thank you very much (in Advance)


[jQuery] Slide in Popup

2009-09-02 Thread Maarten Scherpenisse

Hi folks,

I have been searching and searching, but cloudn't find it.

I'm looking for a slide-in popup (from the top) that does fade's its
background while it slide's. Something like http://mad4milk.net/ when
you press contact. But then in jQuery. I hope someone has the
knowledge how to do it (with jqModal, Fancybox).

Kind regards, Maarten


[jQuery] Re: Check if function exists

2009-09-02 Thread Eric Paige
unsubscribe me

Eric Paige
Web Developer



On Wed, Sep 2, 2009 at 10:44 AM, shapper mdmo...@gmail.com wrote:


 Hello,

 I am loading TinyMCE using the new JQuery Plugin:

 script type=text/javascript
  $().ready(function() {
 $('textarea.tinymce').tinymce({
   // Location of TinyMCE script
 script_url : '../js/tinymce/jscripts/tiny_mce/tiny_mce.js',

 Is there a way to load only if tinymce plugin is present without
 getting an error?

 Basically if I don't want to load the tinymce I just don't load the
 plugin ...
 ... Because I am not able to pass, I think, to my SiteScript.JS file
 if I want to load or not the plugin.

 Thanks,
 Miguel



[jQuery] Re: JQuery Form - Ajax - Please HELP ! ! ! ! ! ! !

2009-09-02 Thread mkmanning

You could just add name attributes to the text fields (e.g. input
type=text id=item_01 name=item_01 class=item_field
value=123/ ) and then just use data:$('#myForm').serialize().

That will give you a querystring like:
item_01=123item_02=456item_03=789 (you can't pass an array to
'data', it expects an object or a string).


On Sep 2, 10:43 am, huntspointer2009 huntspoin...@gmail.com wrote:
 ///Comment:
 Can someone help me do the following:
 create a function that collects ALL of the form's text field's Values,
 along with their corresponding ID, and create an Array like this:
 Example: var dataString = (item_01=123, item_01=456, item_01=789)

 then take the 'dataString' Array, and send it to a Server via Ajax,
 whenever I click the 'Submit Button'

 Please Note:
 that as new items are created/added to the form,
 the 'Submit Button' must be able to continue submitting the
 'dataString' Array to server via Ajax
 whenever I click it.

 // HTML Code :
 form id=myForm action=receive_items.php method=post
     ul
         li
             labelItem_01/label
             input type=text id=item_01 class=item_field
 value=123/
             input type=submit value=delete button
 class=button_delete/
         /li
         li
             labelItem_02/label
             input type=text id=item_02 class=item_field
 value=456/
             input type=submit value=delete button
 class=button_delete/
         /li
         li id=item_03
             labelItem_03/label
             input type=text id=item_03 class=item_field
 value=789/
             input type=submit value=delete button
 class=button_delete/
         /li
     /ul
     input type=submit value=Submit Button class=button_submit/
 /form

 // JQuery Code:
 $(document).ready(function(){
         $('.button_submit').click(function(){
                         $.ajax({
                                 type: POST,
                                 url: receive_items.php,
                                 data: dataString,
                                 success: function(){
                                 alert(The Data was successfully sent to 
 server:);
                                 }
                         });
         });

 });

 - Thank you very much (in Advance)


[jQuery] Re: .not($.browser.msie $.browser.version = 7)

2009-09-02 Thread Matt Kruse

On Sep 2, 6:20 am, IschaGast cont...@ischagast.nl wrote:
 I am having rounded corners in a site but I don't want them in IE
 because it does strange things with the corners.

Many non-IE browsers already have native CSS support for rounded
corners. If you want to exclude IE anyway, why not just use pure CSS?

Matt Kruse



[jQuery] isFunction change in 1.3 and window.opener

2009-09-02 Thread msoliver

Hello,

We've recently upgraded jQuery to 1.3. I've read about the changes to
the isFunction method and have run into a problem. Our site has a
couple of popup windows that, on completion, call back into the parent
window. As such, we had code like this:

var openerFunc = window.opener.pickComplete;
if ($.isFunction(openerFunc))
openerFunc.call(this, rowid(row));
window.close();

In 1.2.6, the isFunction call would return true if the function
existed in the parent. In 1.3, this returns false, because of the
typeof of the openerFunc, once-removed and located in the parent
window, will be object, not function.

Any workaround for this? Should I just plug in the 1.2 isFunction
implementation and call it instead? I understand it had some flaws,
but at least it would provide some check for a use case like this.

Regards,

- Mike


[jQuery] Re: Email obfuscator/defuscator plugin

2009-09-02 Thread brian

I wrote one but have never gotten around to submitting it. Feedback welcome.

/**
 * De-obfuscate printed email addresses which are of the type:
 *
 * span class=Obfuscated title=some title
 * some link text [ someone AT gmail DOT com ]
 * span
 *
 * The braces around the address part are hard-wired here. That should
 * probably be set by a param. Ditto for the AT  DOT.
 *
 * @author brian ally, zijn digital
 **/
jQuery.fn.deobfuscate = function()
{
return this.each(function()
{
var content = $(this).text();

/* grab the part inside the braces, swap out placeholders, and 
trim
 */
var obfuscated = content.match(/\[(.*)\]/);
var address = obfuscated[1]
.replace(' AT ', '@')
.replace(' DOT ', '.')
.replace(/^\s+|\s+$/g, '');

/* get everything before the braces and trim
 */
var text = content.match(/.?[^[]+/);

text = (text[0] != content)
? text[0].replace(/^\s+|\s+$/g, '')
: address;  // if there's no text part, use the 
address

var title = $(this).attr('title') || '';

$(this).replaceWith($('a href=mailto:' + address + ' 
title=' +
title + '' + text + '/a'));
});
};


$(function()
{
$('.Obfuscated').deobfuscate();
});

The title attribute of the span will be given to the link. If you
leave out the some link text part, the email address itself will be
used.

Here's a PHP function to create the span from an email address.

/**
 * Wrap an email address in a formatted span tag in such a way
 * as to allow for easy javascript translation to a normal mailto: link.
 *
 * this:
 * f...@bar.net, 'email foo!', 'some title text'
 * becomes:
 * span class=Obfuscated title=some title textemail foo! [ foo
AT bar DOT net ]/span
 *
 * @param   string  address email address
 * @param   string  textlink text
 * @param   string  title   link title
 * @return  string  obfuscated address, wrapped in i span 
tag
 *
 * @author  brian ally, zijn digital
 **/
function obfuscateEmail($address, $text= null, $title = null)
{
if (empty($address)) return null;

$regexp = 
'^[_a-z0-9-]+(\.[_a-z0-9-]+)*...@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$';
$search = Array('@', '.');
$replace = Array(' AT ', ' DOT ');
$class = 'Obfuscated';

if (is_string($address)  eregi($regexp, $address))
{
$obfuscated = str_replace($search, $replace, $address);

return span class=\${class}\
. (!is_null($title) ?  title=\${title}\ : null)
. ''
. (!is_null($text) ? $text : null)
. [ ${obfuscated} ]/span;
}
return $address;
}


On Wed, Sep 2, 2009 at 12:35 PM, shappermdmo...@gmail.com wrote:

 I found the following one:

 http://plugins.jquery.com/project/RotationalStringObfuscator

 It seems interesting.

 How can I apply it to all emails on my web page?

 Thank You,
 Miguel


[jQuery] error when uploading files

2009-09-02 Thread undertow


I get an error Error: Form elements must not be named submit. when
i have a form with the ability to upload files.  If a file is selected
for upload i get the error, and not when there is no file for upload.
why is that?  what difference does it make if there is a submit
button?


[jQuery] [jQuery Corner] Problem using nested corners/borders

2009-09-02 Thread J. Martin

I am attempting to create a box with malsup's jQuery nested corners,
but can't get it to display properly.

Here's my CSS:
testing { margin: 0; background: #ffc; padding: 10px; border:0; zoom:
1;}
div.outer { float: left; margin: 15px; background: #c82; padding: 8px;
width: 22em }

My JS:
$(function(){
$('.testing').corner(round 8px).parent().css('padding',
'4px').corner(round 10px);
});

I'm using this as my test HTML:
div class=outerdiv class=testingh1Round/h1pTesting/p/
div/div

You can see my testing page at:
http://www.dhome.net/test.php

The result of this is the the above code is that the background color
the box becomes color of the outer div, #c82. The internal border is
not displayed. What is my error?


[jQuery] Conflict with Lightbox 2 Smooth scroll

2009-09-02 Thread evansonuk

Hi,

Having problems with conflicts between Lightbox 2  smooth scroll.

Does anyone know anything about this, or better yet anyone know a way
around this?

I am new to this and not particularly savvy to say the least.

Help would be appreciated.

Thanks


[jQuery] Jquery ajax form

2009-09-02 Thread Fregas

I'm using the jquery form plugin from here:
http://malsup.com/jquery/form/

Is there any callback function or handling of server-side errors in
this plugin so I can now if an ajax action failed?

Thanks,
Craig


[jQuery] Re: Jquery ajax form

2009-09-02 Thread Mike Alsup

 I'm using the jquery form plugin from here:http://malsup.com/jquery/form/

 Is there any callback function or handling of server-side errors in
 this plugin so I can now if an ajax action failed?

That plugin uses $.ajax under the hood so all the same options apply,
including the 'error' callback.


[jQuery] Animating show() and hide() of TBODY

2009-09-02 Thread candlerb

I am writing some code where I want to insert and subsequently hide a
TBODY element within a table, and animate it doing so.

Unfortunately, if I do hide() followed by show(250), say, then the
element becomes
tbody style=display: block
and this results in the inserted section displaying after the end of
the table :-(

Is there an easy way to make this set display: table-row-group
instead? I tried setting that explicitly in the HTML, but that didn't
seem to help.

I'll make a standalone test case if that will help.

Thanks,

Brian.


[jQuery] Strange behaviour when de-activating form

2009-09-02 Thread burlistic

Hi All,

Not sure this is the best place for this question, but I hope someone
can help.

I have a form which requires a lot of client side validation. As this
takes a while I am using an overlay to stop access to the form. The
problem is, the overlay only appears after all valition code has
exectured. Thus rendering it useless.

Standard stuff really... Large div with a class that has display:
none;

Form submit (onsubmit=validate(); return false;) calls the
validation code, which also submits the form if there are no errors.
See code below;

function validate()
{

$('#messageOverlay span').text('Validating');
var messageOverlay = $('#messageOverlay');
$(messageOverlay).removeClass('hide');

//VALIDATION CODE GOES HERE

}

Strangly the overlay appears if I place an alert in the validation
code??

I would really expect the overlay code to run first and dispaly the
message. Why does it only happen after all the code has executed?

I've tried so many things.. Like attaching the overlay code to the
button click and using bind() to attached the method calls seperatly.
Any help greatly appreciated.. If you sovle my problem and live / work
in London I will by you many beers!


[jQuery] Re: isFunction change in 1.3 and window.opener

2009-09-02 Thread msoliver

Fair point. What you suggest certainly would be better than no check.
But, it's not a test that openerFunc is actually a function, just that
it exists and has an call property.

Thanks though,

- Mike

On Sep 2, 11:45 am, Matt Kruse m...@thekrusefamily.com wrote:
 On Sep 2, 1:16 pm, msoliver michaelsoli...@gmail.com wrote:

          if ($.isFunction(openerFunc))

 Why not just:
    if (openerFunc  openerFunc.call)
 ?

 Matt Kruse


[jQuery] Re: small problem

2009-09-02 Thread GaVrA

Yes, in firefox 3.5.2 and windows7 when text is fading in or out -
text color is yellow. :)

Anyone have any idea how to fix this?

And yes, it is working like it should in every other browser.

On Jul 30, 7:29 am, Ricardo ricardob...@gmail.com wrote:
 Nothing like crowd-sourced tests! :)

 Looks good in all browsers. I see it yellow out a little during the
 fade in Firefox 3, it's because of sub-pixel rendering (anti-
 aliasing), color shifts happen occasionaly. Is that what you're
 seeing?

 -- ricardo

 http://www.crtaci.info/

  on top-right position i have search field. When you move your mouse
  over there small text shows up that says:

  Napredna pretraga

  Now, for some reason those letters change color to like yellow for
  very short period of time in ff 3.5 and to some strange color in
  safari 4.0.2 for win. In ie8, opera and chrome it works just the way
  it should, white letters stay white during the animation.

  Any sugestions?


[jQuery] Re: isFunction change in 1.3 and window.opener

2009-09-02 Thread Matt Kruse

On Sep 2, 1:16 pm, msoliver michaelsoli...@gmail.com wrote:
         if ($.isFunction(openerFunc))

Why not just:
   if (openerFunc  openerFunc.call)
?

Matt Kruse


[jQuery] Help getting elements name.

2009-09-02 Thread gilberto.ramoso...@gmail.com

Hello I have a bunch of radio button and I want a funtion tu run when
any of the radio button is clicked so I used $('input:radio').click
(function... what I want to do is to get the name attribute of the
clicked radio, how can i do this?


[jQuery] Re: Help getting elements name.

2009-09-02 Thread MorningZ

because the other programmer
used different names to call them singularly because of some issue
with IE 6  7

technically he *created* an issue with IE since the radio buttons are
not grouped so that the user can only select one in the bunch of them
(if that's what you want, but you don't make that clear or not)

how could i return something to use with GetElementByName

Charlie pointed that out, you've got this, which represents the DOM
object itself, and this.name which is the name parameter


On Sep 2, 4:17 pm, gilberto.ramosoton gilberto.ramoso...@gmail.com
wrote:
 My radio buttons dont have the same name because the other programmer
 used different names to call them singularly because of some issue
 with IE 6  7. Ok What would like to have is the radio button's name,
 the one that got clicked, how could i return something to use with
 GetElementByName,


[jQuery] Re: Help getting elements name.

2009-09-02 Thread gilberto.ramosoton

Great, thanks.

On Sep 2, 4:20 pm, MorningZ morni...@gmail.com wrote:
 because the other programmer
 used different names to call them singularly because of some issue
 with IE 6  7

 technically he *created* an issue with IE since the radio buttons are
 not grouped so that the user can only select one in the bunch of them
 (if that's what you want, but you don't make that clear or not)

 how could i return something to use with GetElementByName

 Charlie pointed that out, you've got this, which represents the DOM
 object itself, and this.name which is the name parameter

 On Sep 2, 4:17 pm, gilberto.ramosoton gilberto.ramoso...@gmail.com
 wrote:

  My radio buttons dont have the same name because the other programmer
  used different names to call them singularly because of some issue
  with IE 6  7. Ok What would like to have is the radio button's name,
  the one that got clicked, how could i return something to use with
  GetElementByName,


[jQuery] Re: Conflict with Lightbox 2 Smooth scroll

2009-09-02 Thread gilberto.ramosoton

Check out the css on both to see that there is not an id or class with
the same name.

On Sep 2, 1:35 pm, evansonuk evanso...@googlemail.com wrote:
 Hi,

 Having problems with conflicts between Lightbox 2  smooth scroll.

 Does anyone know anything about this, or better yet anyone know a way
 around this?

 I am new to this and not particularly savvy to say the least.

 Help would be appreciated.

 Thanks


[jQuery] Re: Help getting elements name.

2009-09-02 Thread Charlie Griefer
$('input:radio').click(function() { alert(this.name); });

But... as radio buttons, wouldn't they all have the same name?

In any event, 'this' (or the jQuery $(this)) will give you a hook into the
element that triggered the click.

On Wed, Sep 2, 2009 at 12:44 PM, gilberto.ramoso...@gmail.com 
gilberto.ramoso...@gmail.com wrote:


 Hello I have a bunch of radio button and I want a funtion tu run when
 any of the radio button is clicked so I used $('input:radio').click
 (function... what I want to do is to get the name attribute of the
 clicked radio, how can i do this?




-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: Help getting elements name.

2009-09-02 Thread gilberto.ramosoton

My radio buttons dont have the same name because the other programmer
used different names to call them singularly because of some issue
with IE 6  7. Ok What would like to have is the radio button's name,
the one that got clicked, how could i return something to use with
GetElementByName,


[jQuery] validation: how do I make sure a radio button is picked?

2009-09-02 Thread Matt Wilson

I have a list of radio buttons, all with the same name, and each has a
different value.

I want a validator that tests if one is picked.  How do I do this?


[jQuery] Re: validation: how do I make sure a radio button is picked?

2009-09-02 Thread Matt Quackenbush
Perhaps I am misunderstanding something in your requirements, but with the
validation plugin (link below), it is as simple as adding class=required
to the input tag.

http://docs.jquery.com/Plugins/Validation

HTH


[jQuery] Is this quirk of jQuery still true?

2009-09-02 Thread Rick Faircloth
I read that in an article dated October 17, 2008, that it was not possible
to change the actual

HTML in the DOM of the value attribute of a text input using
$(this).val('myNewValue');

 

My experiments just now bear this out.

 

Is this still true?  The writer of the article developed a work-around using
a hidden input and

manipulating its value with a rel to the original input.  Is this still the
best way?

 

Thanks for any insights.

 

Rick

 


---

Those who hammer their guns into plows will plow for those who do not.  -
Thomas Jefferson

 



[jQuery] Re: Email obfuscator/defuscator plugin

2009-09-02 Thread shapper

I think the Rot13 is better at least according with the following
results:
http://www.josephfinsterwald.com/UI/Pages/article4.aspx

On Sep 2, 7:01 pm, brian bally.z...@gmail.com wrote:
 I wrote one but have never gotten around to submitting it. Feedback welcome.

 /**
  * De-obfuscate printed email addresses which are of the type:
  *
  * span class=Obfuscated title=some title
  * some link text [ someone AT gmail DOT com ]
  * span
  *
  * The braces around the address part are hard-wired here. That should
  * probably be set by a param. Ditto for the AT  DOT.
  *
  * @author brian ally, zijn digital
  **/
 jQuery.fn.deobfuscate = function()
 {
         return this.each(function()
         {
                 var content = $(this).text();

                 /* grab the part inside the braces, swap out placeholders, 
 and trim
                  */
                 var obfuscated = content.match(/\[(.*)\]/);
                 var address = obfuscated[1]
                         .replace(' AT ', '@')
                         .replace(' DOT ', '.')
                         .replace(/^\s+|\s+$/g, '');

                 /* get everything before the braces and trim
                  */
                 var text = content.match(/.?[^[]+/);

                 text = (text[0] != content)
                         ? text[0].replace(/^\s+|\s+$/g, '')
                         : address;      // if there's no text part, use the 
 address

                 var title = $(this).attr('title') || '';

                 $(this).replaceWith($('a href=mailto:' + address + ' 
 title=' +
 title + '' + text + '/a'));
         });

 };

 $(function()
 {
         $('.Obfuscated').deobfuscate();

 });

 The title attribute of the span will be given to the link. If you
 leave out the some link text part, the email address itself will be
 used.

 Here's a PHP function to create the span from an email address.

 /**
  * Wrap an email address in a formatted span tag in such a way
  * as to allow for easy javascript translation to a normal mailto: link.
  *
  * this:
  * f...@bar.net, 'email foo!', 'some title text'
  * becomes:
  * span class=Obfuscated title=some title textemail foo! [ foo
 AT bar DOT net ]/span
  *
  * @param       string  address email address
  * @param       string  text    link text
  * @param       string  title   link title
  * @return      string                  obfuscated address, wrapped in i span 
 tag
  *
  * @author      brian ally, zijn digital
  **/
 function obfuscateEmail($address, $text= null, $title = null)
 {
         if (empty($address)) return null;

         $regexp = 
 '^[_a-z0-9-]+(\.[_a-z0-9-]+)*...@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$';
         $search = Array('@', '.');
         $replace = Array(' AT ', ' DOT ');
         $class = 'Obfuscated';

         if (is_string($address)  eregi($regexp, $address))
         {
                 $obfuscated = str_replace($search, $replace, $address);

                 return span class=\${class}\
                         . (!is_null($title) ?  title=\${title}\ : null)
                         . ''
                         . (!is_null($text) ? $text : null)
                         . [ ${obfuscated} ]/span;
         }
         return $address;

 }
 On Wed, Sep 2, 2009 at 12:35 PM, shappermdmo...@gmail.com wrote:

  I found the following one:

 http://plugins.jquery.com/project/RotationalStringObfuscator

  It seems interesting.

  How can I apply it to all emails on my web page?

  Thank You,
  Miguel


[jQuery] Re: JQuery Form - Ajax - Please HELP ! ! ! ! ! ! !

2009-09-02 Thread Hunts Pointer

Thanks Michael,
your answer helped me solve the problems I was having, if you're in
NYC let me know, I owe you a beer.
- Hunts


[jQuery] Re: [jQuery Corner] Problem using nested corners/borders

2009-09-02 Thread Leonardo K
Your css is the problem :D

Missing the . before the testing

On Wed, Sep 2, 2009 at 15:14, J. Martin giantsfan2...@gmail.com wrote:


 I am attempting to create a box with malsup's jQuery nested corners,
 but can't get it to display properly.

 Here's my CSS:
 testing { margin: 0; background: #ffc; padding: 10px; border:0; zoom:
 1;}
 div.outer { float: left; margin: 15px; background: #c82; padding: 8px;
 width: 22em }

 My JS:
 $(function(){
$('.testing').corner(round 8px).parent().css('padding',
 '4px').corner(round 10px);
 });

 I'm using this as my test HTML:
 div class=outerdiv class=testingh1Round/h1pTesting/p/
 div/div

 You can see my testing page at:
 http://www.dhome.net/test.php

 The result of this is the the above code is that the background color
 the box becomes color of the outer div, #c82. The internal border is
 not displayed. What is my error?


[jQuery] Re: - issue closing element modal

2009-09-02 Thread hburgund

Sorry, Mike, one more quick question:
My message in this situation is not centered for some reason.  It is
in the upper left of the div it is blocking.  But if I instantiate it
a second time without refreshing the page, it moves to the center,
where I want it.  I tried a bunch of css options to fix this, but
nothing works consistently.  Also tried centerX and centerY, but to no
avail.
Here's what I am passing right now:

css: { border: '1px solid #a00', height:'200px',
width:'300px', fontSize:'9pt'},
centerX: true,
centerY: true

Any ideas?
Thanks again.
-Halsey


On Sep 1, 7:14 pm, Mike Alsup mal...@gmail.com wrote:
  I need a modal window within an element on my page and theBlockUI
  plugin works
  great for this.  The problem is that I want a button on theblockUI
  message that will close the block.  I can't seem to get this to work.
  If I put the button elsewhere on the page, it works to close the
  block, but whenever the button is actually in the block div, it
  doesn't work.  A close button in the block div works fine for full UI
  blocking, just not for element blocking.
  Is this possible?  Any ideas would be much appreciated.
  Thanks.
  -Halsey

  
  code snippet

  $('#paneRecordHeader').click(function() {
          $('#paneRecord').block({
                  message: 'Legal Mumbo Jumbo input type=button
  id=btnAgree
  value=I Agree /'/p',
                  css: { border: '1px solid #a00' }
          });

  });

  $('#btnAgree').click(function() {
           $('#paneRecord').unblock();
   });

 You need to move that click handler so that it is bound when the
 element exists in the DOM:

 $('#paneRecordHeader').click(function() {
     $('#paneRecord').block({
         message: 'Legal Mumbo Jumbo input type=button id=btnAgree
 value=I Agree //p',
         css: { border: '1px solid #a00' }
     });
     $('#btnAgree').click(function() {
          $('#paneRecord').unblock();
     });

 });

 Alternatively, you could use the 'live' method.


[jQuery] Re: isFunction change in 1.3 and window.opener

2009-09-02 Thread Matt Kruse

On Sep 2, 2:21 pm, msoliver michaelsoli...@gmail.com wrote:
 Fair point. What you suggest certainly would be better than no check.
 But, it's not a test that openerFunc is actually a function, just that
 it exists and has an call property.

That seems better to me than the crazy logic in 1.2's isFunction()!

Any time that (typeof openerFunc != 'function') you are going to be
making assumptions. Is there any chance in your code that openerFunc
will be non-null (or undefined) and have a call property? If not, then
how is this check not good enough?

You could make it a little more robust by doing:
   if (openerFunc  typeof openerFunc.call=='function')

Matt Kruse


[jQuery] Jquery DropdownCheckList

2009-09-02 Thread Mr. V

I am trying to use the dropdown check list Jquery plugin from
http://code.google.com/p/dropdown-check-list/

I have a  question about fetching the 'checked' item IDs or the Comma
separated values.

Basically I am calling the getJSON method on Change of the dropdown
and I want to either pass an array of the checked item IDs or the
Comma separated text that is displayed in the control.

What's the best way to do it ?


[jQuery] Response type is Form Plugin success callback

2009-09-02 Thread Lay András

Hello!

How can I determine the response type (text/html, text/javascript,
etc.) in the Form Plugin's success callback? The callback recognize 3
parameters, the first is the data, second is the status, and third is
an object with lots of properties. I mean the response type can be in
this object, but i don't know where.

Lay


[jQuery] How can I manipulate all the radios in one div?

2009-09-02 Thread gilberto.ramoso...@gmail.com

How can I manipulate all the radios in a div? For example say I have 2
div and both have a couple of radio buttons and everyone has different
names. Say I wanted to manipulate only the radios in one of the div's
how could achieve that?


[jQuery] Re: How can I manipulate all the radios in one div?

2009-09-02 Thread Charlie Griefer
assuming the particular div has an id=myDiv attribute...

$('myDiv input:radio')

http://docs.jquery.com/Selectors/descendant#ancestordescendant

(the docs are your friend)

You could also apply a specific class name to the ones you want to
manipulate.  But if you don't want to (or can't) manipulate the markup, the
code above should work.

On Wed, Sep 2, 2009 at 4:12 PM, gilberto.ramoso...@gmail.com 
gilberto.ramoso...@gmail.com wrote:


 How can I manipulate all the radios in a div? For example say I have 2
 div and both have a couple of radio buttons and everyone has different
 names. Say I wanted to manipulate only the radios in one of the div's
 how could achieve that?




-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: - issue closing element modal

2009-09-02 Thread hburgund

Thank you so much, Mike.  Your solution works perfectly.
Thanks again for a great plugin.
-Halsey


On Sep 1, 7:14 pm, Mike Alsup mal...@gmail.com wrote:
  I need a modal window within an element on my page and theBlockUI
  plugin works
  great for this.  The problem is that I want a button on theblockUI
  message that will close the block.  I can't seem to get this to work.
  If I put the button elsewhere on the page, it works to close the
  block, but whenever the button is actually in the block div, it
  doesn't work.  A close button in the block div works fine for full UI
  blocking, just not for element blocking.
  Is this possible?  Any ideas would be much appreciated.
  Thanks.
  -Halsey

  
  code snippet

  $('#paneRecordHeader').click(function() {
          $('#paneRecord').block({
                  message: 'Legal Mumbo Jumbo input type=button
  id=btnAgree
  value=I Agree /'/p',
                  css: { border: '1px solid #a00' }
          });

  });

  $('#btnAgree').click(function() {
           $('#paneRecord').unblock();
   });

 You need to move that click handler so that it is bound when the
 element exists in the DOM:

 $('#paneRecordHeader').click(function() {
     $('#paneRecord').block({
         message: 'Legal Mumbo Jumbo input type=button id=btnAgree
 value=I Agree //p',
         css: { border: '1px solid #a00' }
     });
     $('#btnAgree').click(function() {
          $('#paneRecord').unblock();
     });

 });

 Alternatively, you could use the 'live' method.


[jQuery] Re: get the hover color of a link

2009-09-02 Thread Dale Larsen

Well, it works. I am not sure why my first implementation wasn't
working.

Thank you for your help!

Kind regards,
Dale Larsen


On Aug 25, 6:04 am, Satyakaran satyaka...@gmail.com wrote:
 I think you need to change your approach.
 :hover is not set-able by jquery .

 I tried this

 script

 function hover1() {

 var h = $(':hover', '.test');

 $.each(
 h,
 function( intIndex, intVal ){
           alert($(this).css('color'))
         }
 )

 }

 /script

 div class=test
 a href='http://www.w3schools.com/'onclick=alert($('.test
 a:hover').css('color'));return false;W3Schools1/a
 a href='http://www.w3schools.com/'onclick=alert($('a:hover').css
 ('color'));return false;W3Schools2/a

 a href='http://www.w3schools.com/'onclick=javascript:hover1
 ();return false;W3Schools3/a
 /div

 Here on link 1 and  2 , I am getting the right output but not through
 a function I have tried in 3 link.

 On Aug 25, 4:57 am, Dale Larsen dalelarse...@gmail.com wrote:

  I need to get the css hover color of an element. Since hover is a
  pseudo class of a class or id, I do not see a way of returning the
  color.

  I tried:

  $('.contentArea a:hover').css('color');

  but it does not return the hover color.

  I understand that jQuery probably traverses the inline styles and
  there is no way to set the hover  pseudo class inline, hence the
  reason for the .hover function.

  Is it possible to find and return the hover color with jQuery. If so
  how?


[jQuery] Re: tool tip / ajax / image map

2009-09-02 Thread Scott Sauyet


webguy262 wrote:

I need to get a tooltip that works when the page containing the image and the
image map is ajax-ed into a div...


I think any of them will work, but you'll have to reinitialize them on 
the ajaxed content...


  -- Scott


[jQuery] Re: Is this quirk of jQuery still true?

2009-09-02 Thread Ricardo

The change in value won't appear in the HTML (in firebug for example),
but the value *will* change and be submitted with the form. That's
standard DOM scripting behaviour. There is no reason to change the
attribute in the HTML unless you want to print it somewhere.

On Sep 2, 5:55 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 I read that in an article dated October 17, 2008, that it was not possible
 to change the actual

 HTML in the DOM of the value attribute of a text input using
 $(this).val('myNewValue');

 My experiments just now bear this out.

 Is this still true?  The writer of the article developed a work-around using
 a hidden input and

 manipulating its value with a rel to the original input.  Is this still the
 best way?

 Thanks for any insights.

 Rick

 
 ---

 Those who hammer their guns into plows will plow for those who do not.  -
 Thomas Jefferson


[jQuery] Re: How can I manipulate all the radios in one div?

2009-09-02 Thread gilberto.ramosoton

Thanks a lot man, work like a charm.

On Sep 2, 8:21 pm, Charlie Griefer charlie.grie...@gmail.com wrote:
 assuming the particular div has an id=myDiv attribute...

 $('myDiv input:radio')

 http://docs.jquery.com/Selectors/descendant#ancestordescendant

 (the docs are your friend)

 You could also apply a specific class name to the ones you want to
 manipulate.  But if you don't want to (or can't) manipulate the markup, the
 code above should work.

 On Wed, Sep 2, 2009 at 4:12 PM, gilberto.ramoso...@gmail.com 

 gilberto.ramoso...@gmail.com wrote:

  How can I manipulate all the radios in a div? For example say I have 2
  div and both have a couple of radio buttons and everyone has different
  names. Say I wanted to manipulate only the radios in one of the div's
  how could achieve that?

 --
 I have failed as much as I have succeeded. But I love my life. I love my
 wife. And I wish you my kind of success.


[jQuery] Re: Email obfuscator/defuscator plugin

2009-09-02 Thread brian

ROT13 is not immediately readable to a person who has javascript
disabled. The method I used was specifically designed to keep the
email address obvious to a human.

On Wed, Sep 2, 2009 at 4:46 PM, shappermdmo...@gmail.com wrote:

 I think the Rot13 is better at least according with the following
 results:
 http://www.josephfinsterwald.com/UI/Pages/article4.aspx

 On Sep 2, 7:01 pm, brian bally.z...@gmail.com wrote:
 I wrote one but have never gotten around to submitting it. Feedback welcome.

 /**
  * De-obfuscate printed email addresses which are of the type:
  *
  * span class=Obfuscated title=some title
  * some link text [ someone AT gmail DOT com ]
  * span
  *
  * The braces around the address part are hard-wired here. That should
  * probably be set by a param. Ditto for the AT  DOT.
  *
  * @author brian ally, zijn digital
  **/
 jQuery.fn.deobfuscate = function()
 {
         return this.each(function()
         {
                 var content = $(this).text();

                 /* grab the part inside the braces, swap out placeholders, 
 and trim
                  */
                 var obfuscated = content.match(/\[(.*)\]/);
                 var address = obfuscated[1]
                         .replace(' AT ', '@')
                         .replace(' DOT ', '.')
                         .replace(/^\s+|\s+$/g, '');

                 /* get everything before the braces and trim
                  */
                 var text = content.match(/.?[^[]+/);

                 text = (text[0] != content)
                         ? text[0].replace(/^\s+|\s+$/g, '')
                         : address;      // if there's no text part, use the 
 address

                 var title = $(this).attr('title') || '';

                 $(this).replaceWith($('a href=mailto:' + address + ' 
 title=' +
 title + '' + text + '/a'));
         });

 };

 $(function()
 {
         $('.Obfuscated').deobfuscate();

 });

 The title attribute of the span will be given to the link. If you
 leave out the some link text part, the email address itself will be
 used.

 Here's a PHP function to create the span from an email address.

 /**
  * Wrap an email address in a formatted span tag in such a way
  * as to allow for easy javascript translation to a normal mailto: link.
  *
  * this:
  * f...@bar.net, 'email foo!', 'some title text'
  * becomes:
  * span class=Obfuscated title=some title textemail foo! [ foo
 AT bar DOT net ]/span
  *
  * @param       string  address email address
  * @param       string  text    link text
  * @param       string  title   link title
  * @return      string                  obfuscated address, wrapped in i 
 span tag
  *
  * @author      brian ally, zijn digital
  **/
 function obfuscateEmail($address, $text= null, $title = null)
 {
         if (empty($address)) return null;

         $regexp = 
 '^[_a-z0-9-]+(\.[_a-z0-9-]+)*...@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$';
         $search = Array('@', '.');
         $replace = Array(' AT ', ' DOT ');
         $class = 'Obfuscated';

         if (is_string($address)  eregi($regexp, $address))
         {
                 $obfuscated = str_replace($search, $replace, $address);

                 return span class=\${class}\
                         . (!is_null($title) ?  title=\${title}\ : null)
                         . ''
                         . (!is_null($text) ? $text : null)
                         . [ ${obfuscated} ]/span;
         }
         return $address;

 }
 On Wed, Sep 2, 2009 at 12:35 PM, shappermdmo...@gmail.com wrote:

  I found the following one:

 http://plugins.jquery.com/project/RotationalStringObfuscator

  It seems interesting.

  How can I apply it to all emails on my web page?

  Thank You,
  Miguel


[jQuery] Why is console.log(valid) returning yes in this code?

2009-09-02 Thread Rick Faircloth
Here's the code:

 

var valid = 'yes';

 


$(':input').each(function() {

 


   if   (   $(this).val().length == 0   )

{   alert('in!');

var valid = 'no';

alert(valid);

$('#rentalAppErrors').fadeIn(500);

$(this).addClass('inputError');

$(this).css({'background-color':'red','color':'#fff'});

$(this).val('Entry required...'); }

});

 


console.log(valid);

 

When I run this code making the if statement true, I get the alert('in!')
properly,

letting me know that I'm inside the conditional block.  I also get the
second

alert, alert(valid), and the value of valid in the alert is no.as it
should be.

 

But when the code gets to the console.log(valid) function, valid shows in
the console

as having the value 'yes'.

 

???

 

Why?  This is throwing the rest of my code off.

 

Rick

 


---

Those who hammer their guns into plows will plow for those who do not.  -
Thomas Jefferson

 



[jQuery] Re: Is this quirk of jQuery still true?

2009-09-02 Thread Rick Faircloth

Thanks for the reply, Ricardo...

After thinking about it, it really doesn’t matter if the HTML is changed.
It'll process fine, as you said.

What I was really trying to avoid was a problem with the newly entered
data being removed if I focused on the field with the cursor again.

I came up with a better solution that deleted the error message I put
into the field, but didn't delete the new typed in code.

Rick



-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Ricardo
Sent: Wednesday, September 02, 2009 9:09 PM
To: jQuery (English)
Subject: [jQuery] Re: Is this quirk of jQuery still true?


The change in value won't appear in the HTML (in firebug for example),
but the value *will* change and be submitted with the form. That's
standard DOM scripting behaviour. There is no reason to change the
attribute in the HTML unless you want to print it somewhere.

On Sep 2, 5:55 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 I read that in an article dated October 17, 2008, that it was not possible
 to change the actual

 HTML in the DOM of the value attribute of a text input using
 $(this).val('myNewValue');

 My experiments just now bear this out.

 Is this still true?  The writer of the article developed a work-around
using
 a hidden input and

 manipulating its value with a rel to the original input.  Is this still
the
 best way?

 Thanks for any insights.

 Rick



 ---

 Those who hammer their guns into plows will plow for those who do not.
 -
 Thomas Jefferson




[jQuery] Re: Why is console.log(valid) returning yes in this code?

2009-09-02 Thread MorningZ

Why?

Because you are failing to understand variable scope

Don't use the var keyword inside the if block, by using that, you
are stomping over the outside one

http://www.google.com/search?q=Javascript+variable+scope


On Sep 2, 10:26 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 Here's the code:

 var valid = 'yes';

 $(':input').each(function() {

    if   (   $(this).val().length == 0   )

         {   alert('in!');

             var valid = 'no';

             alert(valid);

             $('#rentalAppErrors').fadeIn(500);

             $(this).addClass('inputError');

             $(this).css({'background-color':'red','color':'#fff'});

             $(this).val('Entry required...');                         }

 });

 console.log(valid);

 When I run this code making the if statement true, I get the alert('in!')
 properly,

 letting me know that I'm inside the conditional block.  I also get the
 second

 alert, alert(valid), and the value of valid in the alert is no.as it
 should be.

 But when the code gets to the console.log(valid) function, valid shows in
 the console

 as having the value 'yes'.

 ???

 Why?  This is throwing the rest of my code off.

 Rick

 
 ---

 Those who hammer their guns into plows will plow for those who do not.  -
 Thomas Jefferson


[jQuery] Re: Jquery ajax form

2009-09-02 Thread Fregas

Thanks!

On Sep 2, 12:55 pm, Mike Alsup mal...@gmail.com wrote:
  I'm using the jquery form plugin from here:http://malsup.com/jquery/form/

  Is there any callback function or handling of server-side errors in
  this plugin so I can now if an ajax action failed?

 That plugin uses $.ajax under the hood so all the same options apply,
 including the 'error' callback.


[jQuery] Re: Why is console.log(valid) returning yes in this code?

2009-09-02 Thread James

I think you mean:
by using that, you are -NOT- stomping over the outside one.

Rick,

If you don't understand, using var is a variable declaration.
Setting: var valid = 'no';
inside the each() callback function will have that variable exist
locally only inside that function. It will not overwrite what you have
set globally.
Since you're doing the console.log outside of that function, it'll use
the one you set in the global scope,
var valid = 'yes';

To fix that, remove the var in: var valid = 'no';


On Sep 2, 4:36 pm, MorningZ morni...@gmail.com wrote:
 Why?

 Because you are failing to understand variable scope

 Don't use the var keyword inside the if block, by using that, you
 are stomping over the outside one

 http://www.google.com/search?q=Javascript+variable+scope

 On Sep 2, 10:26 pm, Rick Faircloth r...@whitestonemedia.com wrote:

  Here's the code:

  var valid = 'yes';

  $(':input').each(function() {

     if   (   $(this).val().length == 0   )

          {   alert('in!');

              var valid = 'no';

              alert(valid);

              $('#rentalAppErrors').fadeIn(500);

              $(this).addClass('inputError');

              $(this).css({'background-color':'red','color':'#fff'});

              $(this).val('Entry required...');                         }

  });

  console.log(valid);

  When I run this code making the if statement true, I get the alert('in!')
  properly,

  letting me know that I'm inside the conditional block.  I also get the
  second

  alert, alert(valid), and the value of valid in the alert is no.as it
  should be.

  But when the code gets to the console.log(valid) function, valid shows in
  the console

  as having the value 'yes'.

  ???

  Why?  This is throwing the rest of my code off.

  Rick

  
  ---

  Those who hammer their guns into plows will plow for those who do not.  -
  Thomas Jefferson




[jQuery] Re: Why is console.log(valid) returning yes in this code?

2009-09-02 Thread Rick Faircloth

 you are stomping over the outside one

Hmmm...that's what I'm trying to do.

I assume you mean by the 'outside' one, the
variable, valid, inside console.log(valid).

I'm initially setting the variable valid to yes
and using the conditional block to change valid to no if there's
an invalid entry in any of the text fields.

Would this not be a proper way to proceed?



--Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of MorningZ
Sent: Wednesday, September 02, 2009 10:36 PM
To: jQuery (English)
Subject: [jQuery] Re: Why is console.log(valid) returning yes in this
code?


Why?

Because you are failing to understand variable scope

Don't use the var keyword inside the if block, by using that, you
are stomping over the outside one

http://www.google.com/search?q=Javascript+variable+scope


On Sep 2, 10:26 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 Here's the code:

 var valid = 'yes';

 $(':input').each(function() {

    if   (   $(this).val().length == 0   )

         {   alert('in!');

             var valid = 'no';

             alert(valid);

             $('#rentalAppErrors').fadeIn(500);

             $(this).addClass('inputError');

             $(this).css({'background-color':'red','color':'#fff'});

             $(this).val('Entry required...');                         }

 });

 console.log(valid);

 When I run this code making the if statement true, I get the
alert('in!')
 properly,

 letting me know that I'm inside the conditional block.  I also get the
 second

 alert, alert(valid), and the value of valid in the alert is no.as it
 should be.

 But when the code gets to the console.log(valid) function, valid shows in
 the console

 as having the value 'yes'.

 ???

 Why?  This is throwing the rest of my code off.

 Rick



 ---

 Those who hammer their guns into plows will plow for those who do not.
 -
 Thomas Jefferson




[jQuery] Re: Why is console.log(valid) returning yes in this code?

2009-09-02 Thread MorningZ

 I think you mean:
 by using that, you are -NOT- stomping over the outside one.

Indeed... a classic case of thinking faster than i was typing


[jQuery] Re: Why is console.log(valid) returning yes in this code?

2009-09-02 Thread Rick Faircloth

Ahhh...that did it.

As MorningZ mentioned, it was a misunderstanding of the scoping of the
variable:
inside vs outside the function.  I thought, too, being a learn as I code
programmer,
that anytime I defined a variable, I needed to precede it with var...
live and learn...or rather, code and learn...

Thanks, James and MZ...

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of James
Sent: Wednesday, September 02, 2009 10:45 PM
To: jQuery (English)
Subject: [jQuery] Re: Why is console.log(valid) returning yes in this
code?


I think you mean:
by using that, you are -NOT- stomping over the outside one.

Rick,

If you don't understand, using var is a variable declaration.
Setting: var valid = 'no';
inside the each() callback function will have that variable exist
locally only inside that function. It will not overwrite what you have
set globally.
Since you're doing the console.log outside of that function, it'll use
the one you set in the global scope,
var valid = 'yes';

To fix that, remove the var in: var valid = 'no';


On Sep 2, 4:36 pm, MorningZ morni...@gmail.com wrote:
 Why?

 Because you are failing to understand variable scope

 Don't use the var keyword inside the if block, by using that, you
 are stomping over the outside one

 http://www.google.com/search?q=Javascript+variable+scope

 On Sep 2, 10:26 pm, Rick Faircloth r...@whitestonemedia.com wrote:

  Here's the code:

  var valid = 'yes';

  $(':input').each(function() {

     if   (   $(this).val().length == 0   )

          {   alert('in!');

              var valid = 'no';

              alert(valid);

              $('#rentalAppErrors').fadeIn(500);

              $(this).addClass('inputError');

              $(this).css({'background-color':'red','color':'#fff'});

              $(this).val('Entry required...');                         }

  });

  console.log(valid);

  When I run this code making the if statement true, I get the
alert('in!')
  properly,

  letting me know that I'm inside the conditional block.  I also get the
  second

  alert, alert(valid), and the value of valid in the alert is no.as it
  should be.

  But when the code gets to the console.log(valid) function, valid shows
in
  the console

  as having the value 'yes'.

  ???

  Why?  This is throwing the rest of my code off.

  Rick

 

  ---

  Those who hammer their guns into plows will plow for those who do not.
 -
  Thomas Jefferson






[jQuery] Re: Is this quirk of jQuery still true?

2009-09-02 Thread RobG



On Sep 3, 6:55 am, Rick Faircloth r...@whitestonemedia.com wrote:
 I read that in an article dated October 17, 2008, that it was not possible
 to change the actual

 HTML in the DOM

There is no HTML in the DOM. HTML is used to create a DOM.


 of the value attribute of a text input using
 $(this).val('myNewValue');

Because that changes the DOM value property, not the HTML value
attribute.

The HTML value attribute (if present) is used to set the DOM
defaultValue property and provide an initial value for the value
property. User initiated changes to the input's value will change the
DOM value property. Setting the value property will change the
displayed value. If the input is in a form and the form is submitted,
the value of the value property is submitted (assuming the input is
successful).

The defaultValue is used to set the value of the input if the form's
reset method is called and can be changed by assigning a new value to
it programmatically.

The HTML attribute value can be changed using setAttribute.

There is no specification for how to generate HTML from a DOM, what
you'll get is dependent on the browser and the method or tool (e.g.
the browser-dependent innerHTML property[1])

Using innerHTML as the tool to convert DOM to HTML, it can be seen
that in IE changes to the element's value property are reflected in
the value attribute but not in Firefox. Other tools may have different
results. If you want consistent behaviour in that regard, do the DOM
to HTML transformation yourself.


 My experiments just now bear this out.

 Is this still true?  The writer of the article developed a work-around using
 a hidden input and

 manipulating its value with a rel to the original input.  Is this still the
 best way?

If you want to reliably set the HTML attribute value, use setAttribute
as it is specified as doing that (and realise that setAttribute is
broken in IE in places).


1. innerHTML is a widely copied IE proprietary property that has no
public specification and is known to be implemented differently in
different browsers.


--
Rob


[jQuery] Re: validation: how do I make sure a radio button is picked?

2009-09-02 Thread RobG



On Sep 3, 6:17 am, Matt Wilson m...@tplus1.com wrote:
 I have a list of radio buttons, all with the same name, and each has a
 different value.

 I want a validator that tests if one is picked.  How do I do this?

Set one as checked by default (as suggested by the W3C HTML
specification), no script or validation needed.


--
Rob


[jQuery] How do I prevent the newly entered text in the text input from disappearing upon focus?

2009-09-02 Thread Rick Faircloth
In code prior to this, if an empty text input is found in a form upon
submission,

the text Entry required. is put into the text input.

 

Once all the text inputs have been validated, then the function below is
run:

 

function validation() {

 

 $(':input.inputError').each(function() {

 

  $(this).focus(function() {

   $(this).val('');



  });

 });

  

 $(':input.inputError').each(function() {

 

  $(this).blur(function() {



   if   (   $(this).val().length  0)

{
$(this).removeClass('inputError').css({'background-color':'#ddd' ,
'color':'#000'});}

   

   if   (   $(this).val().length == 0   )

{   $(this).val('Entry required...');   }

   

  });

 });

}

 

It all works well, except for the fact that once I do make an entry into an
invalid field,

and blur out of that field, then re-focus the cursor in that same field, my
valid data entry

is removed.

 

With the code above, I try to avoid that happening by removing the class,
input error, which

is happening according to Firebug, so I'm not sure why the val is being
reset to '' or nothing

upon re-focus.

 

Thoughts?

 

Have I missed another fundamental javascript coding principle, MZ? ;o)

 

Rick

 


---

Those who hammer their guns into plows will plow for those who do not.  -
Thomas Jefferson

 



[jQuery] Re: Is this quirk of jQuery still true?

2009-09-02 Thread Rick Faircloth

Thanks for the explanation, Rob.

I'll have to check into setAttribute...am I correct in assuming
that setAttribute is a Javascript function, but not jQuery?

Also, your statement, There is no 'HTML in the DOM'.  HTML is used
to create a DOM. seems like semantics.

So is it correct to say that a DOM contains no HTML?

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of RobG
Sent: Wednesday, September 02, 2009 11:05 PM
To: jQuery (English)
Subject: [jQuery] Re: Is this quirk of jQuery still true?




On Sep 3, 6:55 am, Rick Faircloth r...@whitestonemedia.com wrote:
 I read that in an article dated October 17, 2008, that it was not possible
 to change the actual

 HTML in the DOM

There is no HTML in the DOM. HTML is used to create a DOM.


 of the value attribute of a text input using
 $(this).val('myNewValue');

Because that changes the DOM value property, not the HTML value
attribute.

The HTML value attribute (if present) is used to set the DOM
defaultValue property and provide an initial value for the value
property. User initiated changes to the input's value will change the
DOM value property. Setting the value property will change the
displayed value. If the input is in a form and the form is submitted,
the value of the value property is submitted (assuming the input is
successful).

The defaultValue is used to set the value of the input if the form's
reset method is called and can be changed by assigning a new value to
it programmatically.

The HTML attribute value can be changed using setAttribute.

There is no specification for how to generate HTML from a DOM, what
you'll get is dependent on the browser and the method or tool (e.g.
the browser-dependent innerHTML property[1])

Using innerHTML as the tool to convert DOM to HTML, it can be seen
that in IE changes to the element's value property are reflected in
the value attribute but not in Firefox. Other tools may have different
results. If you want consistent behaviour in that regard, do the DOM
to HTML transformation yourself.


 My experiments just now bear this out.

 Is this still true?  The writer of the article developed a work-around
using
 a hidden input and

 manipulating its value with a rel to the original input.  Is this still
the
 best way?

If you want to reliably set the HTML attribute value, use setAttribute
as it is specified as doing that (and realise that setAttribute is
broken in IE in places).


1. innerHTML is a widely copied IE proprietary property that has no
public specification and is known to be implemented differently in
different browsers.


--
Rob




[jQuery] Re: Is this quirk of jQuery still true?

2009-09-02 Thread Scott Haneda


This is an intersting problem though. Without the ability to edit the  
HTML, a page refresh is going to kill any work you did.


Granted, in most cases, the need for a page refresh would not matter,  
as the browser is going to drop the input form data anyway.


One advantage would be you could potentially store the form data.

As web apps become more complex, it may not be form data, but  
positioned elements.


What is the best way to save this state in hopes of protecting the  
user from a refresh? Is it even worth it?


I can see three ways. Local browser data store, not currently  
supported by all browsers.


Second is appending to a refresh link, or the URL directly, some data  
that can store the last state.


Third is use of cookies to store state.

Curious what others chose to use in solving this, or if it is even  
something considered a problem worth solving.


--
Scott
Iphone says hello.

On Sep 2, 2009, at 7:29 PM, Rick Faircloth  
r...@whitestonemedia.com wrote:



Thanks for the reply, Ricardo...

After thinking about it, it really doesn’t matter if the HTML is cha 
nged.

It'll process fine, as you said.

What I was really trying to avoid was a problem with the newly entered
data being removed if I focused on the field with the cursor again.

I came up with a better solution that deleted the error message I put
into the field, but didn't delete the new typed in code.


[jQuery] Ajax get contents question

2009-09-02 Thread David .Wu

This is my testing php code, I found if I use filter, I can only get
the content from first level of object, for example
div id=res1div id=res22/div/div

I can get res's contents by filter, but I can't get res2's contents,
is that possible that get any thing I want through ajax?

?php
if (isset($_POST['g'])) {
echo 'div id=res1div id=res22/div/div';
exit;
}
?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleget/title
script type=text/javascript src=js/jquery-1.3.2.min.js/script
/head

body
div id=show/div
input type=button id=btn1 value=btn1 /
input type=button id=btn2 value=btn2 /
script
$(function() {
$('#btn1').click(function() {
$.post('get.php', {g: 1}, function(data) {
var data = $(data).filter('#res').html();
$('#show').html(data);
});
});
$('#btn2').click(function() {
$.post('get.php', {g: 1}, function(data) {
var data = $(data).filter('#res2').html();
$('#show').html(data);
});
});
});
/script
/body
/html


[jQuery] Re: Problems with minDate on datepicker not allowing before 1999.

2009-09-02 Thread rupak mandal
hi joe,

You have to specify the year range according to your requirement .By
default it is
yearRange: '-10:+10'


Thanks
Rupak

On Wed, Sep 2, 2009 at 8:34 PM, hoe`` jlen...@gmail.com wrote:


 If I do something like, minDate: new Date(1930, 1-1, 14)
 or, minDate: '-70Y'

 The oldest date available will be 1999, and no matter what I've tried
 I've never been able to get beyond this barrier. Is this a limitation
 of datepicker?

 Thank you,
 ~Joe



[jQuery] inArray unintuitive

2009-09-02 Thread goatdubbs

PHP's in_array was created before jQuery's inArray, so I'm not sure of
the origin of the choice of function name jQuery took, but if it was
from PHP, they either named the function incorrectly or created the
function with a return value that is incorrect. I am leaning toward
naming it incorrectly.

An English sentence would say, If an element is in an array, do
something, otherwise do something else. That sentence is based on a
boolean condition and in no way is asking to do something based on
the position of the element in the array. Therefore, a function name
of inArray should return a boolean value, not a numeric position. I
vote to change the name of the function to something more intuitive,
like posInArray, indexOf, indexInArray... so on and so on.

Anyone else agree?


[jQuery] Re: Is this quirk of jQuery still true?

2009-09-02 Thread RobG



On Sep 3, 1:25 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 Thanks for the explanation, Rob.

 I'll have to check into setAttribute...am I correct in assuming
 that setAttribute is a Javascript function, but not jQuery?

setAttribute is a DOM Core method of the Element interface[1]. jQuery
wraps a great many such methods, but not this one. There is rarely any
need to use it for HTML documents, particularly as it is broken in
parts in IE. There is also little use for it as setting the DOM
property directly is simpler (and likely much faster as it doesn't
require a method call). setAttribute may handy for XML documents
though.


 Also, your statement, There is no 'HTML in the DOM'.  HTML is used
 to create a DOM. seems like semantics.

Yes, it is, but in a technical group I think it is important. It is
impossible to know the OP was just a bit lazy or doesn't fully
understand the concepts. Better to be sure than make a wrong
assumption.


 So is it correct to say that a DOM contains no HTML?

Yes. HTML is a markup language, it is interpreted by browsers to
generate a DOM. Javascript interacts with the DOM, not the markup.

An analogy is that a plan is used to build a house. Instructions to
tradesmen to change the design might be reflected in the house, but
aren't automatically reflected in the plans unless you also tell the
draughtsman to change them.  innerHTML and other DOM inspection tools
are like an as built plan of part of the house.

1. URL: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68F082 

--
Rob