maybe you could use the "rel" attribute to set the id of each email
entry in your form (this would be done in php), and then use the value
of "rel" when sending info back to your ajax script

not sure exactly how your html is constructed, but this is roughly
what i am thinking:

<li>
    johnciti...@blah.com <input class="makeprimary" type="button"
rel="123" value="make primary"></input>
</li>

$('.makeprimary').click(function() {
    $.post("js/edit/edit_email.php", {
        task: "setprimary",
        email_ID: $(this).attr('rel')
    }, function(html) {
        $("#emails").html(html);
    });
});


and as far as i am aware, using "rel" in this way is valid xhtml

hth
bhu vidya

On Aug 8, 9:39 am, cookie <king_coo...@hotmail.com> wrote:
> Hi there, I am having this problem but no real ideas on how to solve
> it. I have a edit profile form that is loaded using .load. Within it I
> have a form for editing email addresses with a list of email addresses
> above it, this is also loaded/reloaded as a callback when a state
> change in the emails occurs. The user can add emails, make an email a
> primary and delete emails. My issue is with deleting:
>
>                 $(".removeemail").change( function() {
>                         $.post("js/edit/edit_email.php", { task: 
> "setprimary", email_ID: $
> ("EMAIL ID correspending to the delete button").val() },function(html)
> {
>                                 $("#emails").html(html);
>                         });
>                 });
>
> My issue is with deleting. How do I set the email_ID value without a
> form element only php generated html. Before I would of used
> onchange="somejavascriptfunction(<?php echo $email_id"; ?>)" on the
> delete button but I cannot think of a way of doing this in jquery
> without using a select radio button type thing like I have done for
> setting primary email. Any ideas?

Reply via email to