0

Hi,
I've written a php code where I need to save the data entered in a form to the mysql database.
For that I'm using the following $strSaveTD = "<input type = button id=btnSave value=Save onclick='checkform(" .$iMode. "," .$iLevel. ",1)'>"; When the user clicks on "Save" in IE it works fine - the data is saved and the user is redirected to updated view of the webpage. But when this webpage is accessed via other browsers like Firefox or Chrome the Save button simply doesn't work when I click it. What could be the problem

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by cwarn23
0

Whats with the lack of quotes on there? Try this:

$strSaveTD = "<input type=\"button\" id=\"btnSave\" value=\"Save\" onclick=\"checkform($iMode, $iLevel, 1)\">";

As long as you escape the quotes it will work, the above will print the code as you would expect it to be in HTML (without the backslashes)

0
onclick=\"checkform($iMode, $iLevel, 1)\"

That section of code will not work if you do not have javascript enabled. So make sure javascript is also enabled in Firefox and Crome

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.