apostrophe causes English grad applicants site to fail
One of the candidates for English grad school has an apostrophe in his or her name (e.g. O'Reilly). That is used for the pdf file name for the applicant (i.e. O'Reilly.pdf) and then my code uses a getPDFsList method to grab the file name and populate an array variable using the file name (i.e. $pdf_list
[2] = "O'Reilly"). The javascript in this line fails:
<button onclick="showform(\''.$pdf_list[$i][2].'\')">Assess...</button>
when the value of the variable contains an apostrophe, e.g. :
<button onclick="showform('O'Reilly')">Assess...</button>
My code has assumed only letters, numbers, underscores or dashes in the file name. I was going to modify the php and javascript to escape and unescape as required, but they removed the apostrophe from the PDF file name, thus eliminating the immediate problem.