Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

JQuery - Default innerhtml text with keyup function (copy as you type)

Hello All;

Working Code of Copy as your Type.
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type='text/javascript'>
    $(document).ready(function () {
    $('#Channel').keyup(function (e) {
        var txtVal = $(this).val();
        $('#ChannelCode').val(txtVal);
    });
});
</script>

            Channel ID : <input type=text" ID="Channel" Width="500" value=""><br />
            <div style="height:10px;"></div>
            Copy Code  :  <input type=text" ID="ChannelCode"  ReadOnly ="true" Width="500" value="" /><br />

Open in new window


OK, what I want to do is have a default value at the beginning of the ChannelCode field.
Example
Testing-
So, everything you type into the Channel Field will be added to the end of the above-mentioned text.
If you type in:   Something
You will get
Testing-Something

Thanks, All.
Carrzkiss
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wayne Barron

ASKER

I tried and tried and tried.
And I did not try it the way you provided.
Thank you so much.
Something so simple.
You Rock!

Wayne
You are welcome.