dizzy1 Posted March 2, 2009 Share Posted March 2, 2009 I type a word in a text box and in a <div> tag the results appear of what ive just typed so i can then check if the username exists. THIS WORKS. However it messes up my entire page which is made entirely out of <div> tags, please help its 7.13am and ive been trying to fix it since 11pm. JS var xmlHttp; function checkUser(str){ xmlHttp=new XMLHttpRequest(); var url="test.php"; url=url+"?v="+str; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState == 4) { document.getElementById("Result").innerHTML=xmlHttp.responseText; } } php echo"<div id='Result'>"; $v=$_GET["v"]; $v = trim($v); echo"THE TEXTBOX VALUE IS: $v"; echo"</div>"; Is thier any other way i can do this so the <div> tags dont mess up my entire page. Quote Link to comment Share on other sites More sharing options...
lordphate Posted March 2, 2009 Share Posted March 2, 2009 I always use indecisive tags like <span id="yourid"> </span> or even paragraphs <p id="yourid"> , there are alot of options, but you need to make sure you javascript isn't LOOKING for a div, if it is then you would need to change it as well. Quote Link to comment Share on other sites More sharing options...
dizzy1 Posted March 2, 2009 Author Share Posted March 2, 2009 I always use indecisive tags like <span id="yourid"> </span> or even paragraphs <p id="yourid"> , there are alot of options, but you need to make sure you javascript isn't LOOKING for a div, if it is then you would need to change it as well. Mate ive tried table, p and span, ive even tried puttin it into a textbox but its seems to display every div again so it appears twice overlapping the original and messing up my screen, any other ideas. is it possible to display my results in another page and have that updated, gonna try do it using an include. Quote Link to comment Share on other sites More sharing options...
dizzy1 Posted March 2, 2009 Author Share Posted March 2, 2009 K wot i did was used the <div> tags so it was where i wanted it displayed i did: <div id='Result'></div> Then i made another page which was diffrent from the page which displays all the content testValuepassed.php and put the basic stuff in their. works perfectly Quote Link to comment Share on other sites More sharing options...
lordphate Posted March 2, 2009 Share Posted March 2, 2009 Awesome Glad you figured it out 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.