[jQuery] Re: Show/Hide

2009-09-15 Thread Richard Walsh

I have figured this out, I replaced

$('#add_link').click(function(){
$(this).parent().next('div').show('slow');
});
$('#remove_link').click(function(){
$(this).parent().hide('slow');
});

with

$('a[id=add_link]').click(function(){
$(this).parent().next('div').show('slow');
});
$('a[id=remove_link]').click(function(){
        $(this).parent().hide('slow');
});

On Sep 15, 8:44 am, Richard Walsh  wrote:
> I am working on a toolset that shows/hides divs. The divs are named
> id-1 to id-6.
>
> 
> content
> 
> 
> content
> 
>
> And so on. The script I have written is below:
>
> 
>         $(function(){
>                 $('#id-2').hide();
>                 $('#id-3').hide();
>                 $('#id-4').hide();
>                 $('#id-5').hide();
>                 $('#id-6').hide();
>                 $('#add_link').click(function(){
>                         $(this).parent().next('div').show('slow');
>                 });
>                 $('#remove_link').click(function(){
>                         $(this).parent().hide('slow');
>                 });
>         });
> 
>
> The beginning part basically just hides div 2-6 on load. The next part
> with "#add_link" that adds the next div if needed, and then the last,
> removes the current div. This all works, but only on first set.
>
> So basically I have a repeated piece; as below:
>
> 
>         Identifer 1
>         
>                 - Please Select -
>                 Sec
>                 Row
>                 Seat
>                 Ticket Barcode
>                 RecID
>                 Book No.
>                 Account No.
>                 Other
>         
>         
>         Add
> 
>
> This occurs 6 times, starting on  I add another link
> for removing that div.
>
> As I said above, they first set works, but after that it doesn't. How
> can I get this working so that it works for all 6. I want to try and
> avoid writing a function for all six, as in the future I may have to
> add in more items.


[jQuery] Selectbox

2009-09-15 Thread Richard Walsh

I remember seeing a sample somewhere, now for the life of me when I
actually need to use it. I can't remember how or where I found it. I
am hoping someone can shed some light.

What I want to achieve, is when a value is picked in a select box, an
empty input field appears after a value is selected. If someone can
point me in the right direction it would be great!

Thanks


[jQuery] Re: Selectbox

2009-09-15 Thread Richard Walsh

Actually found what I was looking for, it is here.
http://blog.kotowicz.net/2009/03/jquery-optiontree-demo.html
 Thanks

On Sep 15, 8:50 am, Richard Walsh  wrote:
> I remember seeing a sample somewhere, now for the life of me when I
> actually need to use it. I can't remember how or where I found it. I
> am hoping someone can shed some light.
>
> What I want to achieve, is when a value is picked in a select box, an
> empty input field appears after a value is selected. If someone can
> point me in the right direction it would be great!
>
> Thanks


[jQuery] Show/Hide

2009-09-15 Thread Richard Walsh

I am working on a toolset that shows/hides divs. The divs are named
id-1 to id-6.


content


content


And so on. The script I have written is below:


$(function(){
$('#id-2').hide();
$('#id-3').hide();
$('#id-4').hide();
$('#id-5').hide();
$('#id-6').hide();
$('#add_link').click(function(){
$(this).parent().next('div').show('slow');
});
$('#remove_link').click(function(){
$(this).parent().hide('slow');
});
});


The beginning part basically just hides div 2-6 on load. The next part
with "#add_link" that adds the next div if needed, and then the last,
removes the current div. This all works, but only on first set.

So basically I have a repeated piece; as below:


Identifer 1

- Please Select -
Sec
Row
Seat
Ticket Barcode
RecID
Book No.
Account No.
Other


Add


This occurs 6 times, starting on  I add another link
for removing that div.

As I said above, they first set works, but after that it doesn't. How
can I get this working so that it works for all 6. I want to try and
avoid writing a function for all six, as in the future I may have to
add in more items.



[jQuery] Add class where input differs

2009-06-29 Thread Richard Walsh

I'm writing an application that will show the history of a form, so
for example record 1 is revision 1 and record 14 is revision 14. This
all works fine and dandy, but what I'm trying to achieve is where the
input value differs to highlight the form field.

I'm imaging the code to basically look like this to just apply the
class


$(document).ready(function(){
$('.input').addClass("ui-state-highlight");
});


But how do I identify in the script when to trigger the add class, is
there a differ() function or am I going to have to extend jQuery. I
was looking into a lot of form vaidators where I could see and
simplify based on if field A differed from field B. The concept is
simple enough, just not sure how to envoke it.


[jQuery] jQuery Cookie Plugin

2009-06-08 Thread Richard Walsh

Hey guys, I'm working on a project where I am using the jquery plugin
that Klaus made. The cookie works very well with the exception that
when the user closes the browser the cookie expires. I've been trying
to figure out how I can set the var for expiry so that this doesn't
happen but I am at a loss. Any advice?