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
https://forums.phpfreaks.com/topic/155961-escape-in-javascript/
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
https://forums.phpfreaks.com/topic/155961-escape-in-javascript/#findComment-821021
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.