Computing.Net > Forums > Programming > Javascript String Parsing

Javascript String Parsing

Reply to Message Icon

Original Message
Name: Clicker
Date: October 8, 2004 at 15:09:03 Pacific
Subject: Javascript String Parsing
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



Report Offensive Message For Removal

Response Number 1
Name: Chi Happens
Date: October 12, 2004 at 11:00:22 Pacific
Subject: Javascript String Parsing
Reply: (edit)

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


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Javascript String Parsing

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software