I think you are mixing client and server code. The fieids are on the same page... are you expecting the number of rows to update as you update the field? That would have to be done with javascript, not php.
If you had the blocks field on the previous page that submitted to this page, then the code would work.