Please enable JavaScript to view this site.

iService Forms User Guide

Navigation: Form Commands > $IF

$IF -ispostback

Scroll Prev Top Next More

$IF -isPostBack$ checks whether the user has submitted the current form. When the form is submitted, the page is re-rendered and isPostBack becomes true when it reloads.

 

This is useful when you want to display a different form body or additional information after a form is posted. A simple example is shown below.

 

<html>

<body>

<form method="POST">

Email Address: $input -email -id'email'$<br />

Note: $input -textarea -id'body'$<br />

<input type="submit" id="ok" name="ok" value="Submit Question" /><br />

</form>

 

$If -isPostBack$

You have posted your form.

$Else$

You have not posted your form.

$EndIf$

 

</body>

</html>

 

In this example, the form would look like the following before the note was submitted.

isPostBack1

 

The form would look like the following after the note was submitted.

isPostBack2