- This topic has 1 reply, 2 voices, and was last updated 2 years, 2 months ago by .
- The forum ‘General Discussion’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I have a website where I want to have a random name generator in a page. This random name generator will consist in a form with 3 radio buttons (all, male and female), a button (Generate names) and a list where 10 generated names will appear once you press the button. The random names will be generated from 2 text files (one for males, one for females) with thousands of names.
What would be the best approach to achieve this?
I would create custom single custom table for all the names you want to select from. The table would have a record number, name, and gender.
You could trigger the process with the radio buttons and button to run an AJAX routine on the server. The server generates a random list of number from 1 to the number of records in the table, then executes a query selecting the names that have the matching record number. The AJAX returns the selection list to the browser where you further process it to display the results.
Something like this requires advanced programming skills. There's a lot of moving parts.
© 2022 WPEngine, Inc.