cozzy1984 Posted February 1, 2008 Share Posted February 1, 2008 Hi, I've been looking for a script that will bascially have a div above a form, when i focus or click on each text box within the form the div text above will change telling the user what to enter in, accordingly. Anyone know of one? Link to comment https://forums.phpfreaks.com/topic/88927-ajax-from-that-onfous-input-boxes-changes-div-text/ Share on other sites More sharing options...
phpQuestioner Posted February 1, 2008 Share Posted February 1, 2008 This sounds like basic javascript; you really don't need ajax to do this, unless you want to get the directions sever side. Well a basic example would be like this: <script language="javascript"> function info(director) { document.getElementById('directions').innerHTML = director; } </script> <div id="directions"></div> <br><br> First Name: <input type="text" name="FirstName" onfocus="info('Please Enter Your First Name')"> <br><br> Last Name: <input type="text" name="LastName" onfocus="info('Please Enter Your Last Name')"> Link to comment https://forums.phpfreaks.com/topic/88927-ajax-from-that-onfous-input-boxes-changes-div-text/#findComment-455694 Share on other sites More sharing options...
cozzy1984 Posted February 3, 2008 Author Share Posted February 3, 2008 Cheers mate for your help. Appreciate it. Modified that to include a title and text below which works great. Link to comment https://forums.phpfreaks.com/topic/88927-ajax-from-that-onfous-input-boxes-changes-div-text/#findComment-456820 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.