I have sucessfully populated a textbox with the results of multiple chices in a list.
Now I want to turn those strings into an array using split() so that I can sort them.
The strings are all in the same format (Day, Month, dd, yyyy,)and separated by ‘,’.
I am wondering if the fact that there is always a blank line at the top of the textbox is screwing it up?
Here is the script:
function selectedDate(form)
{
var dateSelection=””;
for (var i=0;i<form1.prices.length;i++)
{
if (form1.prices.options[i].selected)
{
dateSelection+=”n”+form1.prices.options[i].value;
}
}
form1.textbox.value=dateSelection;
}
function seePrice(form)
{
var monthArray=new Array(“January”,”February”,”March”,”April”,”May”,”June”,”July”,”August”,”September”,”October”,”November”,”December”);
var priceArray=new Array(“600″,”900″,”1000″,”1500”);
var selectedMonthArray=form1.textbox.value.split(‘,’);
if(selectedMonthArray[1]==” June”)
{
form.price1.value=(priceArray[0]);
form.pricetotal.value=(priceArray[0]);
}
}