Originally posted by Dasty
hi
going through your convo first i work with asp rather than php but the prob was the script part so just took part in it .......importan tly place this one check also in you
change_value() function
Code:
if(http.readystate==4)
{
//try puttingan alert here and check wether it comes into this if
if(http.status==200)//this assures eveery thing has been done fine
{
//here go withyour responsetext code
}
}
i have used the following way for access and save to a string by concatination to pass it with the xml.send() by using the post method ,i would show its more likely same like chaving checks but using a lil diff method here look at it
Code:
function Getformvalues(fobj,valFunc)//fobj:form object,valFunc:string
{
//note:you can create you form object element here if you
//dont want to pass in a function in this way
//var fobj=document.forms["form name"]
//use fobj.elements[i] method where i represents the name of the element i.e
//in your case check box
var str;
str="";
var cmd;
cmd="";
var val;
val="";
for(var i=0;i<fobj.elements.length;i++)//start loop till length of form elements
{
switch(fobj.elements[i].type)//switch by type {
case "text"://case for the text type
if(valFunc)
{
cmd = valFunc + "(" + 'fobj.elements[i].value' + ")";
val = eval('cmd');//validate if it is sting
}
str += fobj.elements[i].name + "=" + fobj.elements[i].value + "&";//string concatination it will look like "elementname="elementvalue
break;
case "select-one"://for selection menus
str += fobj.elements[i].name + "=" + fobj.elements[i].options[fobj.elements[i].selectedIndex].value + "&";
break;
}
}
str = str.substr(0,(str.length - 1));
return str;
}
change the form names and elements names according to your desired ones
but i still want to be confirmed about these things
ctypedelete
compt[]
Code:
function confirm_use()
{
var fobj;//declare a variable to save the form object
fobj=document.forms["form name"];//save in the variable
var tbl=document.getElementById("ctypedelete");
for(i=0;i<fobj.elements.length-1;i++)
{
var cBox=document.getElementsByName('compt[]')[i];
if(cBox.checked)
{
var http = getHTTPObject();
alert(cBox.value);
url="checkuse.php"
url=url+"?ctname="
url=url+cBox.value;
alert(url);//check ur usrl string also if it is correct
http.onreadystatechange = function()
{
if (http.readyState == 4)
{
alert("INTO READY STATE");
if(http.status==200)
{
alert(http.responseText);
}
else
{
alert("not in ready state");
}
}
}
http.open("GET", url, true);
http.send(null);
}
}
return false;
}
Comment