<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

Recommended Answers

All 2 Replies

Member Avatar for langsor

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.

:-)

i didn't get u? but in that

+s+

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

function showMAName(str,str1)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	alert(str)
	var str=unescape(str);
	alert(str)
var url="getSaname.jsp";
url=url+"?maname="+str+"&rowid="+str1;
document.getElementById("str").value=str1;
xmlHttp.onreadystatechange=stateChanged1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged1() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		var str=document.inetform.str.value
		document.getElementById("lstSAName"+str).innerHTML=xmlHttp.responseText;
	}
}

that ajax function

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.