Why my String value is truncated

Sathish David  Kumar N
Sathish David  Kumar N used Ask the Experts™
on
Hi

 I have drop down , drop down have some values . while change i call  onchange function ij java script its working for all value but give for only

women's care  value . While i am getting this in java script its give only woman ??


how can i get full value
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Because you need to escape the apostrophe. Either by manually doing \ or using escape().

http://www.w3schools.com/jsref/jsref_escape.asp
but women's care  '--------> not coming under escape function right ???
either you make it

<option value ="women's care">

or

<option value ='women\'s care'>

It's dynamaic value
then use escape() only before putting the appending this value
As I said originally, use the escape() function on it.

Even if its a dynamic value, you could at worst, search the string and replace every ' with \' and at best simply escape it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial