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

Thread: Submit textarea

  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    14
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Submit textarea

    Hello,

    How I detect "onfocus event" when the textarea´s content receving the focos, but not by typing and auto submit it to another file.

    The following example well illustrastes I am looking for:


    <html>


    <head>
    <title>Auto submit textarea</title>

    <style type="text/css">
    .normal {
    background-color: white;
    color: black;
    font-weight: normal;
    font-size: 8pt;
    font-family: Arial;
    }
    .accessible {
    background-color: silver;
    font-weight: bold;
    font-size: 10pt;
    }
    </style>
    <script type="text/javascript">
    function fnSetStyle(){
    event.srcElement.className="accessible";
    var oWorkLabel=eval(event.srcElement.id + "_label");
    oWorkLabel.className="accessible";
    }
    </script>

    </head>


    <body>

    <FORM NAME="sorter">
    <INPUT TYPE="TEXT" NAME="sorter2">
    </FORM>

    <FORM NAME="myform">
    <label for="sorter2" class="normal" id="sorter2_label">Enter some text</label>
    <input type="text" class="normal" onfocus="fnSetStyle()" id="sorter2" NAME="sorter2">
    <INPUT TYPE="BUTTON" VALUE="Click Me" onClick="document.myform.sorter2.value = document.sorter.sorter2.value">
    </FORM>
    </body>


    </html>



    In the above example MYFORM2 receives the focos when typed, but not when
    form name SORTER receives the focus, but the values are passed on to the MYFORM2. How I get such feature by code and autosubmit the MYFORM2?

    Can anyone help me please?


    Jan Lee
    Last edited by jan lee; 09-01-2010 at 06:23 PM.

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    945
    Thanks
    19
    Thanked 205 Times in 203 Posts
    Quote Originally Posted by jan lee View Post
    Hello,

    How I detect "onfocus event" when the textarea´s content receving the focos, but not by typing and auto submit it to another file.

    The following example well illustrastes I am looking for:











    In the above example MYFORM2 receives the focos when typed, but not when
    form name SORTER receives the focus, but the values are passed on to the MYFORM2. How I get such feature by code and autosubmit the MYFORM2?

    Can anyone help me please?


    Jan Lee
    Code:
    <INPUT TYPE="BUTTON" VALUE="Click Me" onClick="document.myform.sorter2.value = document.sorter.sorter2.value;document.forms["myform"].submit();">


  •  

    Posting Permissions

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