jd2007 Posted August 9, 2007 Share Posted August 9, 2007 i put it like this: <?php echo "<script src='myareaajax.js'></script><form method='get' onsubmit=my_area('update.php','db=$db&t=$t&c=$c&r=$r&arr=$arr','3');><table border=1><tr>"; for ($b=1; $b<=$num; $b++) { $sql2 = "select * from $_GET[t] where id='$b'"; $result4 = mysql_query($sql2); while ($record = mysql_fetch_assoc($result4)) { while (list($fieldname, $fieldvalue) = each ($record)) { $c++; echo "<td><input type=text id=$c value=$fieldvalue /></td>"; $arr[]="$fieldvalue"; } echo "</tr>"; } $r++; } //print_r($arr."<br /><br />"); $arr=serialize($arr); echo $arr; $table=$_GET["t"]; echo "</table>"; echo "<input type='hidden' name='c' value='$c' />"; echo "<input type='hidden' name='r' value='$r' />"; echo "<input type='hidden' name='t' value='$t' />"; echo "<input type='hidden' name='db' value='$db' />"; echo " <input type='submit' name='update' value='Update' /> </form><br />"; ?> when i click nothing happens...why ? what to do ? pls help... Link to comment https://forums.phpfreaks.com/topic/64065-hi-i-want-the-form-below-to-be-sent-to-a-php-script-using-ajax/ Share on other sites More sharing options...
jitesh Posted August 9, 2007 Share Posted August 9, 2007 check on click is there any javascript error. Link to comment https://forums.phpfreaks.com/topic/64065-hi-i-want-the-form-below-to-be-sent-to-a-php-script-using-ajax/#findComment-319289 Share on other sites More sharing options...
jd2007 Posted August 9, 2007 Author Share Posted August 9, 2007 no Link to comment https://forums.phpfreaks.com/topic/64065-hi-i-want-the-form-below-to-be-sent-to-a-php-script-using-ajax/#findComment-319292 Share on other sites More sharing options...
jitesh Posted August 9, 2007 Share Posted August 9, 2007 What my_area is doing ? Link to comment https://forums.phpfreaks.com/topic/64065-hi-i-want-the-form-below-to-be-sent-to-a-php-script-using-ajax/#findComment-319296 Share on other sites More sharing options...
jd2007 Posted August 9, 2007 Author Share Posted August 9, 2007 this : <!-- var xmlHttp; var stg; //var xmlHttp2; function my_area(src, variables, stage) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url=src; var info=variables; stg=stage; url=url+"?"+info; xmlHttp.open("GET",url,true); xmlHttp.onreadystatechange=stateChanged; xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4) { var myarea="myarea"+stg; document.getElementById(myarea).innerHTML=xmlHttp.responseText; } } function GetXmlHttpObject() { var xmlHttp=null; //var xmlHttp2=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); //xmlHttp2=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); //xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); //xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; //return xmlHttp2; } //--> Link to comment https://forums.phpfreaks.com/topic/64065-hi-i-want-the-form-below-to-be-sent-to-a-php-script-using-ajax/#findComment-319301 Share on other sites More sharing options...
jitesh Posted August 9, 2007 Share Posted August 9, 2007 from your code Not getting what do you want on click submit. Link to comment https://forums.phpfreaks.com/topic/64065-hi-i-want-the-form-below-to-be-sent-to-a-php-script-using-ajax/#findComment-319306 Share on other sites More sharing options...
jd2007 Posted August 9, 2007 Author Share Posted August 9, 2007 yes Link to comment https://forums.phpfreaks.com/topic/64065-hi-i-want-the-form-below-to-be-sent-to-a-php-script-using-ajax/#findComment-319314 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.