Community > Discussions
38 views
1 replies

Generating a random number in Live Forms

Hi All,

I am trying to create a random number field and I having some issues. 
I tried "Bind or update a single form field via Javascript" using the JS Math.floor(Math.random() * 100000) 

Because of Math.random() method I am using in the javascript action, it gives different value at client side and server-side. This causes an error when submitting the form.

Has anyone created a random number field before? if so could you please give me an idea on how to achieve a Random Number field.

 

 

Jordan Marsh Jordan Marsh
Published 11/09/2021 21:08
Add Comment
Ashish Pachori

I would recommend you to use SELECT RAND() SQL query in Bind or update a single form field via SQL Query action. Which will also give you some random number.

See https://www.mandeeps.com/support/knowledgebase/live-forms-actions-on-form-view-bind-or-update-a-single-form-field-via-sql-query

replied 11/10/2021 11:19

Last Activity 11/19/2021 04:02