Mysticated Posted April 2, 2007 Share Posted April 2, 2007 This is the procedure: User logs in, PHP reads databases and populates a form User edits form and hits save, AJAX calls PHP to write new info to database. The form is echoed AND populated using Javascript. For example: <? echo "Email: <input type=\"text\" name=\"email1\" value=\"$x\" />" ?> The problem is my Javascript code can't see these functions. I can only interact with forms that were written statically. What to do? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 2, 2007 Share Posted April 2, 2007 easiest way is to put the functions on the main page Quote Link to comment Share on other sites More sharing options...
obsidian Posted April 2, 2007 Share Posted April 2, 2007 What is it you're trying to do? PHP and Javascript are mutually exclusive. Once the form has been written using PHP, Javascript can reference it. You just have to make sure you're referencing it accurately. Also, you need to make sure that your javascript is not trying to access form elements on the page before they are rendered in the DOM. 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.