Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for postback

Status
Not open for further replies.

developer155

Programmer
Joined
Jan 21, 2004
Messages
512
Location
US
How can I check with JS that this is postback?

Thanks
 
Write dynamic Javascript code. When .NET, ASP, PHP, or other CGI is building the page, it knows that the page has been posted. So write different Javascript code.
Code:
<%
Dim postbackFlag
If Request.Form("Submit") = "Order Stuff" Then
  postbackFlag = "This is a post back."
End If
%>
<html>
...
<script>
var beenHereBefore = "<% Response.Write( postbackFlag )%>";
if( beenHereBefore == "This is a post back." ) {
//Do something differently.
}
</script>
...
</html>

Substitute your favorite CGI equivalent of Response.Write and so forth.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top