PDA

Click to See Complete Forum and Search --> : Find in string


Ryan
Aug 29th, 2000, 03:13 PM
in my javascript, i grab the value of a the drop down menu, the value will look like, "34,myfile.txt"

How can I get every right of the comma? the value could hold anything or be any length, I just need everything right of the comma..

Is it possible in javascript?

Thanks,
Ryan

noone
Aug 29th, 2000, 05:30 PM
var myVar = "34,myfile.txt";
var myNewVar = myVar.substring(myVar.indexOf(",",0)+1);
alert(myNewVar);