Jump to content

randomize submit form button value??


suess0r

Recommended Posts

[code]<?php
$button_text = array('Make it so','What's the score?','Happy Feet');

echo '<input type="submit" name="submit" value="' . $button_text[array_rand($button_text)] . '">'; ?>[/code]

You may have to move the array_rand function out from between the brackets ( [ and ] ), but the idea is the same.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.