Hi I want to validate a textfield with javascript. Here is my code in php:
$question_type = "<input type='text' id='question_type_n' onkeyup="allnumeric(this.value)" name='question_type_n_".$qid."' value='".$d[0]."' >";
I also have the function allnumeric() in javascript. But it returns errors. Javascript-Error:
Parse error: syntax error, unexpected 'allnumeric' (T_STRING) in E:\Share\xampp\htdocs\Dropbox\icsurvey\application\views\finish_survey.php on line 142
$question_type = "<input type='text' id='question_type_n' onkeyup='allnumeric(this.value)' name='question_type_n_".$qid."' value='".$d[0]."' >";