I got a function that checks the value of a form and displays it to you before submission. Its written outside of PHP, but PHP is writing the HTML to call it when the user hits submit.
Well, I want to make it do more. I want it to display 2 values. I got it to do that, but I need it to pass the second value through PHP before displaying it. Basically the 2nd value is a number, and the number acts as an index key for an array with messages in it.
I figure it's as easy as passing more parameters to the function, but,
I need to know how to write that. I know you need to use double, not single quotes in order to parse variables in PHP, but the problem is the onClick already required double quotes, and breaking it into multiple echo statements doesn't seem to be working.
I swear, I change even one little thing about the javascript and for some reason it wont work at all.
I have no idea what's going on.
Here's a rough of the code.
Echo "<input type='submit' value='derrrrr' onClick='return confirmSubmit(this.form)' /></form>";
Where this.form
is, I also need to pass $thearray[]
(into the function).