Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I have another question for you...
i'm tryin got parse string from HTML tags to a Javascript function for some manipulations...
I have a input type=text field when I type in some phrases with space only the the first word gets passed to a javascript function.
i'm using the onclick() to pass the values.
ie..
var example = document.form_name.field_name.value;
this only gives me the first word not the entire text that i have seperated with spaces.
does anybody know how can i pass the entire data, are there any other functions that i can use..
thanks in advance.
Clicker

Haven't had that issue, i use getElementById:
<html>
<script language="JavaScript">
function GetItAll()
{
var TextStuff = window.document.getElementById('testtext').value;
alert(TextStuff);
}
</script>
<body>
<input type='text' name='testtext'>
<input type='button' onclick='JavaScript:GetItAll();'>
</body>
</html>Hope this helps,
Chi

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |