User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,939 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,815 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 511 | Replies: 2
Reply
Join Date: Feb 2008
Posts: 36
Reputation: brr is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
brr brr is offline Offline
Light Poster

how to use escape and unescape

  #1  
Aug 8th, 2008
<input type=text class=text_box2 name=lstMAName"+s+" onchange=showMAName(escape(this.value),"+s+") id=select2>

in the above code iam sending the selected value to the ajax function showMAName(str,str1) in select.js
but there iam not getting the full value of this.value ( means if any space in the string like "how r u", iam getting only "how")
i here that the solution is escape and unescape but i use like in above code but not working
can u plz tell me

thanqs
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2008
Posts: 375
Reputation: langsor is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 34
langsor langsor is offline Offline
Posting Whiz

Re: how to use escape and unescape

  #2  
Aug 9th, 2008
I don't know if this is your problem, but be nice to your browser -- quote your attribute properties. I'm thinking it should look more like this...
<input type="text" class="text_box2" name="lstMAName" + s + onchange="showMAName( escape( this.value )," + s + ")" id="select2" />

Question:
So what is this +s+ following the name attribute and in the showMAName function arguments?

If it's supposed to be a javascript variable, is this line supposed to be being written with a javascript write() because that piece of information sure would come in handy to solving your problem

If it's not a javascript variable then what is it exactly

And if it is a javascript variable but not generated with a javascript write() then your html element is not getting that data.

If you clarify your situation I will try to help you more

Otherwise escape() and unescape() work as prescribed.

:-)
Reply With Quote  
Join Date: Feb 2008
Posts: 36
Reputation: brr is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
brr brr is offline Offline
Light Poster

Re: how to use escape and unescape

  #3  
Aug 11th, 2008
i didn't get u? but in that is a javascript variable
and what ever i am sending the that code
<input type="text" class="text_box2" name="lstMAName" + s + onchange="showMAName( escape( this.value )," + s + ")" id="select2" />
is wrote in javascript only
and come to the function showMAName
  1. function showMAName(str,str1)
  2. {
  3. xmlHttp=GetXmlHttpObject();
  4. if (xmlHttp==null)
  5. {
  6. alert ("Your browser does not support AJAX!");
  7. return;
  8. }
  9. alert(str)
  10. var str=unescape(str);
  11. alert(str)
  12. var url="getSaname.jsp";
  13. url=url+"?maname="+str+"&rowid="+str1;
  14. document.getElementById("str").value=str1;
  15. xmlHttp.onreadystatechange=stateChanged1;
  16. xmlHttp.open("GET",url,true);
  17. xmlHttp.send(null);
  18. }
  19.  
  20. function stateChanged1()
  21. {
  22. if (xmlHttp.readyState==4)
  23. {
  24. var str=document.inetform.str.value
  25. document.getElementById("lstSAName"+str).innerHTML=xmlHttp.responseText;
  26. }
  27. }
that ajax function
Last edited by peter_budo : Aug 12th, 2008 at 11:34 am. Reason: Use code tags instead of quote!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 6:35 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC