vytas Posted February 16, 2007 Share Posted February 16, 2007 I have a textbox , and i have a javascript that gets the value of that textbox and writes it down.But everytime the function is called the textbox disapears .I think i need to use the return but i don't now how. <html><head><title>h</title></head><body><script type="text/javascript">function getValue(){ var r = document.getElementById('field1').value return (r) }</script><br><input type="text"value="hallo"name="field1"onblur="getValue()">hallo</body></html> Hope some1 can sort this one out. Link to comment Share on other sites More sharing options...
kvnmck18 Posted February 16, 2007 Share Posted February 16, 2007 I don't get what you are doing... ?Like print the input value on the site?(You need the input to be close... <input />) Link to comment Share on other sites More sharing options...
vytas Posted February 16, 2007 Author Share Posted February 16, 2007 Well closing it with / is only in XHTML .I want to print the value of the textbox on the page ,without the textbox disapearing. Link to comment Share on other sites More sharing options...
jesh Posted February 16, 2007 Share Posted February 16, 2007 You might try this: <script type="text/javascript">function getValue(){ var r = document.getElementById('field1').value document.getElementById("TextValue").innerHTML = r;}</script><div id="TextValue"></div><input type="text"value="hallo"name="field1" onblur="getValue();" /> Link to comment Share on other sites More sharing options...
vytas Posted February 16, 2007 Author Share Posted February 16, 2007 Thx it works smooth. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now