[jQuery] append return onto text value

2010-01-19 Thread Benn
How do I append a hard return onto a text value box so that it causes
it to submit the form?


[jQuery] Re: Submission of a form creates popin

2009-12-12 Thread Benn
I ended up modifying the href of a link with the values of the form
fields and having the form click on it. here's the HTML/JQuery:

HTML:

form name=aformname action=http://www.google.com/d.jsp;
target=iframe method=post id=bid
input type=text id=ccc name=ccc value= class=text /
input type=submit name=go value= id=button
/form
a href=# rel=prettyPopin id=form_submit
style=display:nonepopin/a

JQuery:

script
$(document).ready(function(){
$('#bid').submit(function(event){
event.preventDefault(); // prevent the form from activating
var lsAction = $(this).attr(action);
var lsCCCvariable = $('#ccc').val();

$('#form_submit').attr(href,'iframe.html?a=' + lsAction + 
'ccc='
+ lsCCCvariable).click();
});
$(a[rel^='prettyPopin']).prettyPopin({});
});
/script

not the most elegant solution: any suggestions?

On Dec 11, 1:26 pm, Benn bennmey...@gmail.com wrote:
 This should be a simple matter: I'm using a plugin, prettyPopin. and I
 want a form to submit to it (activate it). How do I get prettyPopin to
 activate on form submit!


[jQuery] Submission of a form creates popin

2009-12-11 Thread Benn
This should be a simple matter: I'm using a plugin, prettyPopin. and I
want a form to submit to it (activate it). How do I get prettyPopin to
activate on form submit!


[jQuery] Re: Submission of a form creates popin

2009-12-11 Thread Benn
I'd also be open to trying non-plugins

On Dec 11, 1:26 pm, Benn bennmey...@gmail.com wrote:
 This should be a simple matter: I'm using a plugin, prettyPopin. and I
 want a form to submit to it (activate it). How do I get prettyPopin to
 activate on form submit!


[jQuery] put the value of an xml file in an array

2009-09-08 Thread Benn

my goal is to put a bunch of SKUs contained in an xml file into an
array, but the value is not being set so that it can be used later in
the jQuery.get.

I have html like this:

select id=select
option val=foobar selected=selectedFoo Bar/option
option val=barBar/option
option val=fooFoo/option
/select

I have an xml file constructed like this:

?xml version=1.0 encoding='ISO-8859-1'?
sale
item
skufoo123/sku
nameFoo Bar/name
/item
item
skubar123/sku
nameBar/name
/item
item
skufoo321/sku
nameFoo/name
/item
/sale

and jquery like this:

var gsText = 
var laArray = new Array();
$(document).ready(function(){
$(#select option).each(function(i){
var gsText = $(this).text();
jQuery.get(http://www.test.com/xml/test.xml,{},function(xml)
{
// Run the function for each item tag in the XML file
$('item',xml).each(function() {
itemName = $(this).find(name).text();
if(itemName == gsText){
laArray[i] = $(this).find(sku).text();
}
});
});
});
alert(laArray) //this is the line that doesn't work!
});


[jQuery] Re: get values from a select menu then assign them to an array variable

2009-09-08 Thread Benn

var laArray = new Array();
$(document).ready(function(){
$(.cat2 option).each(function(i){
laArray[i] = $(this).val();
})
alert(laArray)
})

On Sep 7, 11:20 pm, runrunforest craigco...@gmail.com wrote:
 Hi,

 I have a menu like this:

     select size=8 class=cat2
         option value=com1vaio/option
         option value=com2thinkpad/option
         option value=mob1nokia/option
         option value=mob2samsung/option
     /select

 Can I get all the values com1, com2, mob1 and mob2 then assign them to
 a variable ?


[jQuery] Re: get values from a select menu then assign them to an array variable

2009-09-08 Thread Benn

i is the count for the each statement making a key for the array: for
example the first dropdown option would have an array key/value
pairing of '0','com1'



On Sep 8, 2:06 am, runrunforest craigco...@gmail.com wrote:
 Owsome Benn. But i don't understand why i is used there ?


[jQuery] list insert out of order

2009-08-18 Thread Benn

IE7/8 and Safari, but not FF are showing dropdown menu items out of
alphabetical order when they're pulled in to a separate div, does
anybody have any hints as to how it could be put into order

Here's the current HTML:
div class=fill_container
div class=fill_me/div!-- .fill_me --
/div!-- .fill_container --
select id=select
option class=btext_1 value=1btext 1/option
option class=atext_2 value=2atext 2/option
option class=ctext_3 value=3ctext 3/option
/select

Here's the current JS:
$(document).ready(function(){
  $(#select option).each(function(){
var itemClass = $(this).text();
$('.fill_me').append('a href=#img src=' + itemClass + '.gif
class=' + itemClass + ' alt=' + itemClass + ' //a');
});
});

Here's the goal generated HTML:
div class=fill_container
div class=fill_me
  a href=#img src=atext_2.gif class=atext_2
alt=atext_2 //a
  a href=#img src=btext_1.gif class=btext_1
alt=btext_1 //a
  a href=#img src=ctext_3.gif class=ctext_3
alt=ctext_3 //a
/div!-- .fill_me --
/div!-- .fill_container --


[jQuery] Change the contents of a div after it has been created

2009-08-14 Thread Benn

I'm trying (rather unsuccessfully) to fill a div that was created by
jquery. I feel like the code should work: any hints or solutions?

Here's my html:
div class=test_area
div class=foo/div
div class=fooAlt/div
/div

Here's my javascript:
$(document).ready(function(){
$('.foo').append('a href=#img src=1.gif class=1 alt=1st
image //a');
$('.foo a img').click(function(event){
event.preventDefault();
$('.foo').attr('alt');
})
});


[jQuery] Re: Change the contents of a div after it has been created

2009-08-14 Thread Benn

missed a line, the JS should be:

$('.foo').append('a href=#img src=1.gif class=1 alt=1st
image //a');
$('.foo a img').click(function(event){
event.preventDefault();
var fAlt = $('.foo').attr('alt');
$('.fooAlt').text(fAlt)
})

On Aug 14, 2:30 pm, Benn bennmey...@gmail.com wrote:
 I'm trying (rather unsuccessfully) to fill a div that was created by
 jquery. I feel like the code should work: any hints or solutions?

 Here's my html:
 div class=test_area
 div class=foo/div
 div class=fooAlt/div
 /div

 Here's my javascript:
 $(document).ready(function(){
 $('.foo').append('a href=#img src=1.gif class=1 alt=1st
 image //a');
 $('.foo a img').click(function(event){
                 event.preventDefault();
                 $('.foo').attr('alt');
         })

 });


[jQuery] Re: Change the contents of a div after it has been created

2009-08-14 Thread Benn

I tried changing the HTML/Javascript to this:

$(#select option).each(function(){
var value = $(this).html();
$(this).addClass(value);
$('.foo').append('a href=#img src=' + value + '.gif
class=' + value + ' alt=' + value + ' //a');
});
$('.foo a img').click(function(event){
event.preventDefault();
var fAlt = $('.foo a img').attr('alt');
$('.fooAlt').text(fAlt)
})

select id=select
option value=11 test/option
option value=22 test/option
option value=33 test/option
/select
div class=test_area
div class=foo/div
div class=fooAlt/div
/div

And it is still not working: I am filling the div with a select menu:
is that the problem?


[jQuery] Select Option add Class

2009-08-10 Thread Benn

This might have been resolved, but I can't find a solution with my
search. I'm trying to add a class with the text of the option. Simple
to do the selected option, but not all of them it seems.

I want to change:

select class=required id=custom1 name=custom1
option selected= value=/
option value=1Text 1/option
option value=2Text 2/option
option value=3Text 3/option
/select

to:

select class=required id=custom1 name=custom1
option selected= value=/
option value=1 class=Text 1Text 1/option
option value=2 class=Text 2Text 2/option
option value=3 class=Text 3Text 3/option
/select

I have tried $('#selectList :selected').text() and $.map($
('#foo :selected'), function(e) { return $(e).text(); }) but to no
avail... I feel like I'm missing something


[jQuery] Re: Select Option add Class

2009-08-10 Thread Benn

this worked great! thank you muchly!

On Aug 10, 11:19 am, Eduardo Pinzon edcpin...@gmail.com wrote:
 try this:
 $(#custom1 option).each(function(){
       var class = $(this).html();
       addClass(class);

 });

 Eduardo Pinzon
 Web Developer

 2009/8/10 Benn bennmey...@gmail.com



  This might have been resolved, but I can't find a solution with my
  search. I'm trying to add a class with the text of the option. Simple
  to do the selected option, but not all of them it seems.

  I want to change:

  select class=required id=custom1 name=custom1
  option selected= value=/
  option value=1Text 1/option
  option value=2Text 2/option
  option value=3Text 3/option
  /select

  to:

  select class=required id=custom1 name=custom1
  option selected= value=/
  option value=1 class=Text 1Text 1/option
  option value=2 class=Text 2Text 2/option
  option value=3 class=Text 3Text 3/option
  /select

  I have tried $('#selectList :selected').text() and $.map($
  ('#foo :selected'), function(e) { return $(e).text(); }) but to no
  avail... I feel like I'm missing something


[jQuery] manipulate the next element with a class

2009-07-15 Thread Benn

Is there a non-structure specific way of finding the next element with
a given class? for example you have a structure of:

div id=container1
  a href=# class=link1link/a
  div class=a1asdf/div
/div!-- #container1 --

div id=container2
  a href=# class=link1link/a
  div class=a1ghjl/div
/div!-- #container2 --

div id=container3
  a href=# class=link1link/a
  div class=a1qwer/div
/div!-- #container3 --

When you click on the link in container1 the expected behavior is to
change the css on a1 in container2 but not in container1 or
container3. I have tried playing with parent, next and filter without
success. this is the best I have is:

$(document).ready(function(){
  $(.link1).click(function(){
$(.a1).css({visibility:hidden}); //hides all a1's but keeps
the space
  });
});