One way you could do this is pass the text from your form input through a function, and store the resulting string in your database.
eg,
<?php
function formatpostcode($postcode) {
$removable = array("-", " "); /*any characters which may be in your postcode, other than the digits, which you need to remove*/
$p = str_replace($removable,"",$postcode);/*remove characters*/
$p = chunk_split($p,3," ");/*Insert space after every 3rd element*/
rtrim($p, " ");/*remove trailing space*/
return $p;
}
?>
Assuming your input text from your form is from a field called 'Postcode'
In the WA DataAssist Insert server behavior, change the text which reads
((isset($_POST["Postcode"]))?$_POST["Postcode"]:"")
to
((isset($_POST["Postcode"]))?formatpostcode($_POST["Postcode"]):"")
which should apply the text formatting to your input string, before it is stored in the database