Results 1 to 3 of 3
  1. #1
    shaburnburn is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default How to take input from a form and then output a replace rule

    I'm trying to make a user web app that takes a text box and uses it for a var str replace function. I have this so far. Please be specific. I'm really new at this.


    XML Code:
    <script type="text/javascript">
    var str = "";
    document.write(str=replace("A","U").replace("T","A").replace("C","G").replace("G","C").replace(",","").replace(")","").replace("(","").replace(".","").replace("[","").replace("[","").replace("1","").replace("2","").replace("3","").replace("4","").replace("5","").replace("6","").replace("7","").replace("8","").replace("9","").replace("0","").replace("-","").replace("_","").replace("+","").replace("=","").replace("!","").replace("?","").replace("<","").replace(">","").replace("@","").replace("#","").replace("$","").replace("%","").replace("^","").replace("&","").replace("*","").replace("`","").replace("~","").replace("x","").replace("z","").replace("v","").replace("b","").replace("n","").replace("m","").replace("s","").replace("d","").replace("f","").replace("k","").replace("h","").replace("j","").replace("l","").replace("p","").replace("o","").replace("i","").replace("y","").replace("r","").replace("e","").replace("w","").replace("q",""));
    
    function myfunction()
    {
    str = document.getElementById('mytextbox').value
    document.write(str);
    }
    </script>
    
    
    <form action="#" onSubmit="return false; myfunction();">
    <input type="text" name="mytextbox" id="mytextbox" />
    
    <input type="submit" />
    </form>

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: How to take input from a form and then output a replace rule

    Sorry, but you're in the wrong place. This is a Java forum, not a Javascript one: they're different languages.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,416
    Rep Power
    20

    Default Re: How to take input from a form and then output a replace rule

    Off topic. Closing the thread.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. how can i get an output in a form ?
    By PhreakLemmon in forum Java Applets
    Replies: 2
    Last Post: 05-02-2011, 09:33 AM
  2. Input/ output file
    By 3MAD in forum New To Java
    Replies: 1
    Last Post: 04-15-2011, 12:59 PM
  3. how to retrieve data when i select the input from the form
    By sharanya in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 03-08-2011, 10:39 AM
  4. File input output
    By edcaru in forum New To Java
    Replies: 5
    Last Post: 12-19-2010, 05:52 PM
  5. designing form to input into database
    By javahsm in forum New To Java
    Replies: 2
    Last Post: 11-29-2008, 10:37 PM

Posting Permissions

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