1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Assign null value to parameter in jquery function

Discussion in 'jQuery' started by dineshsingh1984, Dec 9, 2013.

  1. #1
    How to Assign null value to parameter in this function
    <script type="text/javascript">
    $(document).ready(function(){
    function alpha_numeric(an) {
    var TCode = document.getElementById(an).value;
    for(var i=0; i<TCode.length; i++)
    {
    var char1 = TCode.charAt(i);
    var cc = char1.charCodeAt(0);
    if((cc>47 && cc<58) || (cc>64 && cc<91) || (cc>96 && cc<123) || (cc==32) || (cc==95))
    {
    }
    else
    {
    alert('Special character are not allowed\n\nPlease enter only alphanumeric and underscore');
    here i want to assign null value parameter or input field(#filcompname) but field name or id is not static it's dynamic or multiple field
    return false;
    }
    }
    }
    $('.wrapper .accountinfo .information li.inputs #filcompname').live('keyup',function(){
    var an = $(this).attr("id");
    alpha_numeric(an);
    });
    });
    </script>
     
    dineshsingh1984, Dec 9, 2013 IP