Calling a PHP Function

I have an input field as below that is calling a PHP Function CheckLotNo with a click event.

<input name="lotno" id="lotno" onclick="CheckLotNo()" type="text" value="" />

<?php function CheckLotNo() { }

I have a number of click events calling Java Script functions that work fine but in this case I need to call a PHP function?

I get the error message “Function CheckLotNo() not found.”

Is there some way to get a click event to call a PHP Function?

No.

However, you can make JS call a script that calls this PHP function (e.g. via AJAX). You could also check out SOAP, but that’s definitely more work as you need to create a SOAP server.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.