Forum Moderators: open
Firstly you could include the contents of your CSV file in a hidden IFRAME element on the form page. thusways
<iframe name="csvsource" src="filename.csv" style="visibility:hidden"></iframe>
A word of warning though. You will find it difficult to separate the lines of the csv file once in this IFRAME. I'd suggest that you include an end marker on the end of each line of your CSV file (such as the # symbol).
Now in your javascript you can get a handle to your csv content as follows;
//This get's hold of the text
var csv=frames["csvsource"].document.body.innerHTML;//This next line will split it into separate lines
var lines=csv.split("#");
//Now itterate through each line
for(var n=0;n<lines.length.n++)
{//split current line into separate fields
var fields=lines[n].split(",");
//Now make the check
if(fields[1]==departure)&&(fields[2]==arrival))
{//this line meets criteria.
alert("found a record");
}
If you are stuck with client side, and have trouble following my suggestion, I could probably knock up an entire example document to show you the separate parts in context. Maybe displaying the possible alternatives to the client, to allow them to choose which one they want.