Jump to content

Escape , in javascript


sandy1028

Recommended Posts

Hi,

 

Suppose two values are appended with ;

i.e

 

for example

This is a function

 

function append(){

filter('alerts', document.getElementById('view_alert').value + ";" + document.getElementById('id').value);

}

 

and if document.getElementById('id').value has a "," in it. Does it ignores the string after ",".

 

 

<form onSubmit="append(); return false;">

 

the value after submitting the form the

document.getElementById('id').value doesnot contain string after comma.

 

 

Link to comment
Share on other sites

and if document.getElementById('id').value has a "," in it. Does it ignores the string after ",".

Is that the question?

No, javascript doesn't magically start ignoring the rest of a string once it finds a comma.

Your alert should show all of the text in both view_alert and id with a ';' in the middle.

 

And please use

[code]

[/code] tags to post code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.