• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

[Help]Random name generator in a WordPress page?

Welcome!

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.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › [Help]Random name generator in a WordPress page?

This topic is: not resolved

Tagged: genesis, javascript, php, Wordpress

  • This topic has 1 reply, 2 voices, and was last updated 2 years, 11 months ago by Victor Font.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 7, 2020 at 10:05 am #497206
    harryagamez
    Participant

    Hello there.

    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?

    Throughout Javascript? Php?

    https://puppybellies.com/
    March 8, 2020 at 2:05 pm #497218
    Victor Font
    Moderator

    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.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble