Question : value of the textbox is not picked by the javascript page.

value of the textboxes is not picked by the javascript page.

problem in the function editq .
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
index.php

Edit
 
editform.js
 
function editform(id){
//alert("editform")
var obj=document.getElementById("editform");
h.open('get','editform.php?id='+id);
h.onreadystatechange=function(){
	if(h.readyState == 4){
		//alert(h.readyState)
		obj.innerHTML=h.responseText;
	}
}
h.send(null);
}
 
function edity(){
//alert("editq")
var n=encodeURI(document.getElementById("name").value);
var a=encodeURI(document.getElementById("address").value);
alert(n)
alert(a)
var obj=document.getElementById("display");
h.open('get','editq.php?id='+id+'&name='+n+'&address='+a);
h.onreadystatechange=function(){
	if(h.readyState == 4){
		alert(h.readyState)
		obj.innerHTML=h.responseText;
		alert(h.responseText);
	}
}
h.send(null);
}
 
editform.php



	
Name
Address
Open in New Window Select All

Answer : value of the textbox is not picked by the javascript page.

Try to add the value attrubute to the input element even if is empty when the page loads.



And are you sure that there isn't other attributes with name or id as 'name' ord 'address' in the resulting html page?
Random Solutions  
 
programming4us programming4us