Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with emailform

    I have my email form all set up on my page with no problems. I am trying to get a text message in the box that they fill in and I would like to have a random text message each time the page loads. I can get one text message if I put value= but can not get any random text to work. I am pretty new at this so all help would be appriciated. thank you

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Can we have your code to see what you've done so far?
    (Please wrap your codes by [code][/code] tags while posting here.)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Aug 2008
    Location
    Northern Ireland
    Posts
    167
    Thanks
    12
    Thanked 6 Times in 6 Posts
    This would need to be done with some Javascript or some server side language.

    1. Create array of possible outputs (or grab them from a database)
    2. Select on random one (a random number between 0 and arraylength-1 should do it!)
    3. Put it in as the value.

  • #4
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <code>
    <html>
    <head>
    </p>
    <p class="storyheadline">Vote for who you think is the best </p>


    <p>
    <span><form name="Vote" method="post" action="http://community.cnhi.com/formmail2.php" enctype="multipart/form-data">
    <input name="redirect" value="http://www.angelfire.com/giggle8dsvote/index.html" type="hidden">
    <input name="recipient" value="giggle8ds@hotmail.com" type="hidden">
    <input name="subject" value="Vote - Submission" type="hidden">
    <input name="require" value="Name, email" type="hidden">

    <br><br>
    <table align="center" width="400" cellpadding="5" cellspacing="5" border="0">
    <tr>
    <td valign="middle" align="left">
    Singer
    </td>
    <td valign="middle" align="center">
    <input name="Singer"
    <SELECT
    NAME="size"

    <OPTION VALUE=""></SELECT>

    </td>
    </tr>
    <tr>
    <td valign="middle" align="left">
    TV Star
    </td>
    <td valign="middle" align="center">
    <input name="TV Star" size="35" maxlength="30" type="text">
    </td>
    </tr>
    Other
    <br>
    <input name="New Group 2" size="35" maxlength="30" type="text">
    </td>
    <td valign="bottom" align="center">
    <br><br>
    <br>
    <br>
    <input name="New Group 2 Submission" size="35" maxlength="30" type="text">
    </td>
    </tr>
    <tr>
    <td valign="bottom" align="left">
    <br><br>
    Other
    <br>
    <input name="New Group 1" size="35" maxlength="30" type="text">
    </td>
    <td valign="bottom" align="center">
    <br><br>
    <br>
    <br>
    <input name="New Group 1 Submission" size="35" maxlength="30" type="text">
    </td>
    </tr>
    <tr>
    <td valign="middle" align="left">
    <br><br>
    <b>Your Name</b>
    </td>
    <td valign="middle" align="center">
    <br><br>
    <input name="Name" size="35" maxlength="30" type="text">
    </td>
    </tr>
    <tr>
    <td valign="middle" align="left">
    <br><br>
    <b>Your Email</b>
    </td>
    <td valign="middle" align="center">
    <br><br>
    <input name="email" size="35" maxlength="30" type="text">
    </td>
    </tr>
    </table>
    <br><br>
    <center>
    <input name="Submit" value="Submit" type="submit">
    <input name="Reset" value="Reset" type="reset">
    </center>
    <br><br></span></p>

    </body>
    </html>
    </code>

  • #5
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the following is a code that I got from the internet to try out but it did not work when I put it in to my code. I have tried the section <OPTION VALUE="the following code"> and in the type="the following code" still dont work and dont know that I am doing wrong

    <SCRIPT LANGUAGE="Javascript"><!--


    function text() {
    };

    text = new text();
    number = 0;

    // textArray
    text[number++] = "Random text string 1."
    text[number++] = "Random text string 2."
    text[number++] = "Random text string 3."
    text[number++] = "Random text string 4."
    text[number++] = "Random text string 5."
    // keep adding items here...

    increment = Math.floor(Math.random() * number);

    document.write(text[increment]);

    //--></SCRIPT>




    function getMessage() {
    // create array of murphy laws
    var ar = new Array(20)
    ar[0] = "Nothing is as easy as it looks."
    ar[1] = "Everything takes longer than you think."
    ar[2] = "Anything that can go wrong will go wrong."
    ar[3] = "If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong."
    ar[4] = "If there is a worse time for something to go wrong, it will happen then."

    var now = new Date()
    var sec = now.getSeconds()
    document.random.random.value="Murphy's Law: " + ar[sec % 20]
    }
    getMessage()


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •