Sairam

Sairam

  • NA
  • 321
  • 416.2k

String function in query ., to check contains and replace string

Nov 28 2011 1:08 AM
hi.,


Based on drpodown box selection . , i want to display logo of concern.,

example 
Corcen name can be like this 

sun-123
macro-12
macro 123

Have to take the string that is present before - or empty space
like 
sun
macro
macro

and all the image files are not in same format ., each and everyone is gif or tif ,jpeg... ,,How to select a image of any type keeping name alone ....


            var imgctry = $('#<%= DropconList.ClientID %> option:selected').text();
            imgctry = imgctry.replace(' ', '');
            alert(imgctry);
            var imgpath = "images/Flag/Carrier Brands" + imgctry + ".png";
            $jqry('#DivBillerImg').html('<img src=' + imgpath + ' width="50" height="50"> ');



Thanks
Akila

Answers (1)