phpjayx Posted December 21, 2012 Share Posted December 21, 2012 So I have a logon page php page, which I'm attempting to send other data over to after it does its look up in the database for the user... My debugger shows the data is correctly extracted from my database but I cant get the SUBMIT to work to send over the 'message1'...... Is there anything here that I'm doing completely wrong? Thanks in advance HTML CODE....................... <form action="other_view.php" method="post" id="form_submit"> <input name="userid" class="invinsible" id="userid_submit" > <input name="message1" class="invinsible" id="message1_submit" > <input value="Go to other view" type="button" onclick="onclickSubmit();" > </form> PHP CODE............................ function onclickSubmit() { var userId = parseInt(document.getElementById('userId').innerHTML); var MSG1 = document.getElementById('mainmessage').innerHTML; if (userId == '0') { alert('Please log in'); } else { document.getElementById('userid_submit').value = userId; document.getElementById('message1_submit').value = MSG1; } } Quote Link to comment Share on other sites More sharing options...
DavidAM Posted December 21, 2012 Share Posted December 21, 2012 1) That is NOT PHP code, it is Javascript code. 2) INPUT elements do NOT have any innerHtml to be retrieved 3) You are trying to retrieve data ByID for ID's that do NOT exist in that code. Quote Link to comment Share on other sites More sharing options...
codefossa Posted December 22, 2012 Share Posted December 22, 2012 4) Please use code tags. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.