this not valid syntax

var name_bit = email_addy.(split("@")[0]);

try

var name_bit = email_addy.split("@")[0];

to note, either piece of code would produce undesirable results if the
user doesn't enter a "@" in the field.. you should check for that as
well



On Jan 13, 3:52 pm, typenerd <chairman...@gmail.com> wrote:
> <code>
>                 $(document).ready(function(){
>                         $("#email").change(function () {
>                                 var email_addy = $('#email').val();
>                                 var name_bit = email_addy.(split("@")[0]);
>                                 $('#username').val() = name_bit;
>                         }).change();
>                 });
> </code>
>
> I'm getting an XML error on the split function; can someone help me take
> this:
>
> dave.t...@test.com
>
> and split that into 2 pieces:
>
> dave.test
> &
> test.com
> --
> View this message in 
> context:http://www.nabble.com/split-email-address-into-2-fields--syntax-error...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to