jquery colorpicker help

jquery colorpicker help

heres my html:

  1. <p class="colorp">
    <label for="color1">color1</label>
    <input name="color1" id="color1" type="text" size="10" value="ff0000" />
    <img src="images/icon-color.png" />
    </p>


    <p class="colorp">
    <label for="color2">color2</label>
    <input name="color2" id="color2" type="text" size="10" value="ff0000" />
    <img src="images/icon-color.png" />
    </p>

heres my jquery:

  1.     $('.colorp img').ColorPicker({
            onBeforeShow
    : function () {
                $
    ('.colorp img').ColorPickerSetColor($('.colorp input').val());
           
    },
            onChange
    : function (hsb, hex, rgb) {
                $
    ('.colorp input').css('border-color', '#'+hex);
                $
    ('.colorp input').val('#'+hex);
           
    }
       
    });

all i want this to do is work so i can add as many of these color fields i want. i.e. color3, color4, color5...using the same query code.

however when i use this code it changes ALL fields.

ive tried using this and it still doesnt work:

  1.     $('.colorp img').ColorPicker({
            onBeforeShow
    : function () {
                $
    (this).ColorPickerSetColor($(this).parent().find("input").val());
           
    },
            onChange
    : function (hsb, hex, rgb) {
                $
    (this).parent().find("input").css('border-color', '#'+hex).val('#'+hex);
           
    }
       
    });