Computing.Net > Forums > Programming > Javascript String Parsing

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Javascript String Parsing

Reply to Message Icon

Name: Clicker
Date: October 8, 2004 at 15:09:03 Pacific
OS: XP
CPU/Ram: 1.6 GHz / 512 Meg
Comment:

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




Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: October 12, 2004 at 11:00:22 Pacific
Reply:

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


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Javascript String Parsing

Javascript String Replace www.computing.net/answers/programming/javascript-string-replace/12794.html

Batch Scripts - string parsing www.computing.net/answers/programming/batch-scripts-string-parsing/12733.html

batch file string parsing www.computing.net/answers/programming/batch-file-string-parsing/16603.html