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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    User submitting into a javascript file

    Is it possible for the user to input text into a form on a site and for that text to be put into a javascript "quotes" file which will then display that text on a page?

    So, for instance, you've got this .js file uploaded

    --------

    var quotes=new Array()

    quotes[0]='Text1'

    quotes[1]='Text2'

    var whichquote=Math.floor(Math.random()*(quotes.length))
    document.write(quotes[whichquote])

    ----------

    Could a user input Text3 into a form and it appears in the .js file as -

    quotes[2]='Text3'

    ----------

    and so on?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Can't be done with javascript as far as I know. You'll need to use a serverside language, such as php or asp.


  •  

    Posting Permissions

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