Custom Form that will change status automatically?

So I wanna have a Custom Form that will hide from users when it gets 20 submissions.
Any suggestions?

The only thing I can think of is having a javascript solution to this.


On the "Thank you" page, you nest an asset listing which lists submission assets. Make the total number of assets into a variable:


    var num = %asset_count%;


Make the type format blank.

Then, write some more javascript to check that value:

    if (num == 20) {
     // Make an ajax call to a trigger that will put the form under construction
    }



Not the ideal solution, but I think it would work.

One thing is not good… When it will be 19 submissions already and few people will start completing Custom Form - one will finish & other probably will see login screen when they click on submit button.


It's the best solution so far, so I'll try to implement it tomorrow :slight_smile:

Instead of a trigger I'll use Javascript API function.



Thanks, Nic.

Yeah, sadly it is not ideal. :frowning:

It works!


I used setAssetStatus() function from Javascript API.



Asset statuses values can be found in:

http://manuals.matrix.squizsuite.net/concepts/chapters/squiz-matrix-concepts/#status-values

[quote]
It works!



I used setAssetStatus() function from Javascript API.



Asset statuses values can be found in:

http://manuals.matrix.squizsuite.net/concepts/chapters/squiz-matrix-concepts/#status-values

[/quote]



Wonderful!