Save button not working in Firefox or Chrome

Reply

Join Date: Feb 2009
Posts: 1
Reputation: pecussionist is an unknown quantity at this point 
Solved Threads: 0
pecussionist pecussionist is offline Offline
Newbie Poster

Save button not working in Firefox or Chrome

 
0
  #1
Feb 19th, 2009
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
Last edited by peter_budo; Feb 21st, 2009 at 5:03 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: Save button not working in Firefox or Chrome

 
0
  #2
Feb 19th, 2009
Whats with the lack of quotes on there? Try this:
  1. $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)
Last edited by Will Gresham; Feb 19th, 2009 at 6:11 pm.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,459
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 136
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: Save button not working in Firefox or Chrome

 
0
  #3
Feb 21st, 2009
  1. onclick=\"checkform($iMode, $iLevel, 1)\"
  2.  
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
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC