here I found something interesting!
http://www.webmasterworld.com/forum88/5375.htm
and also the ajax code
for html head
Code: Select all
<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript">
function getScriptPage(div_id,status,more_options,act_id)
{
subject_id = div_id;
status = document.getElementById(status).value;
switch(more_options)
{
case '1':
{
http.open("GET", "script_page.php?val1=" + escape(content1)+"&val2=" + escape(content2)+"&val3=" + escape(content3), true);
}
break;
case '2':
{
http.open("GET", "script_page.php?delete=1&id=" + escape(act_id), true);
}
break;
case '3':
{
http.open("GET", "done.php?status=" + escape(status)+"&id=" + escape(act_id), true);
}
break;
}
http.onreadystatechange = handleHttpResponse;
http.send(null);
document.getElementById(content_id1).value ="";
document.getElementById(content_id2).value="";
document.getElementById(content_id3).value="";
}
function reset(content_id1,content_id2,content_id3)
{
document.getElementById(content_id1).value ="";
document.getElementById(content_id2).value="";
document.getElementById(content_id3).value="";
}
</script>
//hint case 1 is what you want and it sends data to one location with special values
there should be no problem if you add another line for somewhere else location too
and for form
Code: Select all
<div class="input-div">
<TABLE border="0" class="CommentsofT" cellspacing=0 width="200px" cellpadding="5">
<TR>
<TD colspan="2"><strong>???????</strong></TD>
</TR>
<TR>
<TD><strong>??? :</strong></TD>
<TD align="left" class="commenthelpHed"><INPUT TYPE="text" NAME="name" id="s"></TD>
</TR>
<TR>
<TD><strong>????? :</strong></TD>
<TD align="left" class="commenthelpHed"><INPUT TYPE="text" NAME="email" id="text_content2"></TD>
</TR>
<TR>
<TD><strong>????? :</strong></TD>
<TD align="left" class="commenthelpHed"><TEXTAREA NAME="comment" ROWS="4" COLS="30" id="text_content3"></TEXTAREA></TD>
</TR>
<TR>
<TD colspan="2" align="center" >
<INPUT TYPE="submit" value="?????" onMouseUp="getScriptPage('output_div','s','text_content2','text_content3','1','x')">
<INPUT TYPE="button" onClick="reset('text_content1','text_content2','text_content3')" value="Reset">
</TD>
</TR>
</TABLE>
</form>
</div>
sorry dude you change it the way you want it
the language inside is persian and also the ajax file is included, don't add any "<form ...."
if you're interested to use my and my friend code plz add or name as hint thanks
"Sarah Aria"
the ajax.js
Code: Select all
subject_id = '';
function handleHttpResponse() {
if (http.readyState == 4) {
if (subject_id != '') {
document.getElementById(subject_id).innerHTML = http.responseText;
}
}
}
function getHTTPObject() {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object