How can I use input Box ID from PHP to JavaScript?

后端 未结 3 2127
滥情空心
滥情空心 2021-01-29 03:27

My JavaScript function works fine, but I have problems getting different ids from the PHP input box.

JavaScript

window.onload = function()
{   
new JsD         


        
3条回答
  •  感动是毒
    2021-01-29 03:42

    Change:

    id= \"inputField+$k\" name=...
    

    To:

    id=\"inputfield$k\" name=...
    

    What is screwing it up is the "+" sign. PHP uses "." to concatenate strings. ECHO out $k properly and you shouldn't have any trouble

提交回复
热议问题