Hi All

Great forum, very helpfull.

I've a simple problem whereby I have a form which highlights all form tags
on focus() - no problem here, the problem occurs when a user clicks on the
"add new" link to clone the first row and append it to the last spot in the
table, this works really well 

   !! BUT !!

the form elements lose the highlighting effect, big problem as this affects
the accessibility of the page, I can only image that because its a
dynamically added block of elements, that its not being read by the jquery
object ??

code:=====================================
<html>
<head>
  <title>Hello!</title>
  <script src="js/jquery.js" type="text/javascript"></script>

  <script>
$(document).ready(function() {

    $('input').css('border','1px solid white');

        $("input").focus(function() {
        $(this).css({ border: "1px solid red"});
    });

        $("input").blur(function() {
        $(this).css({ border: "1px solid white"});
    });

        $("a").click(function() {

        $("#tab1 tbody tr:first").clone().appendTo("#tab1 tbody");
        $("#tab1 tbody tr:last td").find('input').attr('id','row3');

    });

});

</script>
</head>
<body bgcolor="#CCFFFF">

<table id="tab1">
<thead><tr><td>header</td></tr></thead>
<tbody>
<tr>
    <td><input type="text" /></td>
</tr>
<tr>
    <td><input type="text" /></td>
</tr>
<tr>
    <td><input type="text" /></td>
</tr>
<tr>
    <td><input type="text" /></td>
</tr>
</tbody>
</table>

# add new 

</body>
</html>
end code:==================================

As the focus() function is not being used by the new input tag, I'd imagine
that all calls made to the Jquery object will not work ???

As i'd like to submit the new rows input value via $.ajax() to insert data
into a database, which is also not working, i belive the 2 are related which
is why i've only shown code for the highlighting.

Any ideas !!!!

Many thanks

triggsley
 

-- 
View this message in context: 
http://www.nabble.com/input-losses-styles-after-append%28%29-tf3272396.html#a9098712
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to