Click here to Skip to main content
15,914,419 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Templates in DW CS3 Pin
daveyerwin24-Mar-10 4:38
daveyerwin24-Mar-10 4:38 
QuestionBrowser Compatibility Issue? Pin
Razanust24-Mar-10 3:05
Razanust24-Mar-10 3:05 
AnswerRe: Browser Compatibility Issue? Pin
daveyerwin24-Mar-10 4:08
daveyerwin24-Mar-10 4:08 
QuestionJavascript IE 8 Issue Pin
salmonraju23-Mar-10 20:35
salmonraju23-Mar-10 20:35 
AnswerRe: Javascript IE 8 Issue Pin
daveyerwin24-Mar-10 2:59
daveyerwin24-Mar-10 2:59 
QuestionHow to pass form data to another form. Pin
esebagel23-Mar-10 9:28
esebagel23-Mar-10 9:28 
AnswerRe: How to pass form data to another form. Pin
Not Active23-Mar-10 9:38
mentorNot Active23-Mar-10 9:38 
GeneralRe: How to pass form data to another form. Pin
esebagel23-Mar-10 11:06
esebagel23-Mar-10 11:06 
GeneralRe: How to pass form data to another form. Pin
Not Active23-Mar-10 13:30
mentorNot Active23-Mar-10 13:30 
GeneralRe: How to pass form data to another form. Pin
esebagel24-Mar-10 2:14
esebagel24-Mar-10 2:14 
Questionhelp me .. need uplaod center! Pin
PHP_Guy23-Mar-10 8:35
PHP_Guy23-Mar-10 8:35 
AnswerRe: help me .. need uplaod center! Pin
Not Active23-Mar-10 9:13
mentorNot Active23-Mar-10 9:13 
AnswerRe: help me .. need uplaod center! Pin
Jayapal Chandran4-Apr-10 7:36
Jayapal Chandran4-Apr-10 7:36 
QuestionSmileys symbols in textbox Pin
greendragons22-Mar-10 5:21
greendragons22-Mar-10 5:21 
AnswerRe: Smileys symbols in textbox [modified] Pin
daveyerwin22-Mar-10 10:13
daveyerwin22-Mar-10 10:13 
GeneralRe: Smileys symbols in textbox Pin
greendragons23-Mar-10 12:12
greendragons23-Mar-10 12:12 
QuestionBrochure design tips Pin
Madison121-Mar-10 21:10
Madison121-Mar-10 21:10 
AnswerRe: Brochure design tips Pin
Arindam Tewary21-Mar-10 22:04
professionalArindam Tewary21-Mar-10 22:04 
QuestionWebsite design problem Pin
john563221-Mar-10 21:04
john563221-Mar-10 21:04 
AnswerRe: Website design problem Pin
enhzflep21-Mar-10 22:07
enhzflep21-Mar-10 22:07 
GeneralRe: Website design problem Pin
john563221-Mar-10 22:29
john563221-Mar-10 22:29 
GeneralRe: Website design problem Pin
john563222-Mar-10 0:46
john563222-Mar-10 0:46 
AnswerRe: Website design problem Pin
fhdendy22-Mar-10 7:34
fhdendy22-Mar-10 7:34 
Questionsubmit a form using ajax not working and page is still reloaded Pin
rajiv_kadam21-Mar-10 20:05
rajiv_kadam21-Mar-10 20:05 
i have written ajax code and save as ajx.js and i have written my asp code and saved as addwork.asp my problem is
when i click on image go then it should insert records into database without reloading the page but it reloads the page so please help me here is my code below
addwork.asp code below



<!--#include file="common.asp"-->
<!--#include file="headers.asp"-->
<script type="text/javascript" src="ajx.js"></script>

<%
q=request("q")
CheckAdminLogin()
OpenDataBase conn
'if request("flag")=1 then
'compl=0 means task is pending
'compl=1 means task is completed
'compl=2 means task is cancelled
completed=0
uname=request("uname")
txt=request("txt")

dat=now


if uname="" then er=er & "Title cannot be blank"
if txt="" then er=er & "Work description cannot be blank"
if er="" then

sql="insert into wrk(titles,desck,datss,usernames,userid,completed) values('" & cstr(uname) & "','" & cstr(txt) & "','" & cstr(dat) & "','" & session("adminname") & "'," & session("userid") & "," & completed & ")"

conn.execute sql

response.write "<font size=4 color=green>work description Submitted sucessfully</font>"

else
response.write "<font color='#FF0000' size='+1'>" & er & "</font>"
end if
'end if
%>
<form action="addwork.asp" method="post">
<table>
<tr>
<td>
<font size="+1">
Title</font>
</td>
<td><input type="text" name="uname"></td>

</tr>
<tr>
<td><font size="+1">Work</font></td>
<td>
<textarea name="txt" rows="20" cols="35"></textarea>

</td>
</tr>
<tr>
<td></td>
<td><input type="hidden" name="flag" value="1">
<!--<input type="submit" name="submit" value="submit" onClick="showHint(this.value)">-->
<INPUT TYPE="image" SRC="submit_button.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form" onClick="showHint(this.value)">
<span id="txthint"></span>
</td>
</tr>
</table>
</form>
addwork.asp code ends here
now ajx.js code starts below


var xmlhttp;

function showHint()
{

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Your browser does not support XMLHTTP!");
return;
}
var uname=document.getElementById("uname").value;
var txt=document.getElementById("txt").value;
var url="addwork.asp";
url=url+"?uname="+uname+"?txt="+txt;
//url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{

if (xmlhttp.readyState==4)
{
document.getElementById("txthint").innerHTML="thank you"
}
}

function GetXmlHttpObject()
{

if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlhttp;
}
AnswerRe: submit a form using ajax not working and page is still reloaded Pin
burntblark22-Mar-10 5:04
burntblark22-Mar-10 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.