Q:

jquery form field write issue

I am updating hidden field in form with jquery. it works just fine for first three clicks after that it shows only first element value.
Here is working js fiddle jsfiddle link:
when users is clicking on tab the value of fileorurl changes to 1,2 or 3. it works for first 3-5 click but after that the value stocks to only 1. here is html
<div class="container" id="upload">
    <div class="row">
        <form id="upload-form2"
              action="http://way2enjoy.com/modules/compress-png/converturl16.php"
              name="arjun"
              method="post"
              enctype="multipart/form-data">
            <div id="tab" class="btn-group" data-toggle="buttons">
                <a href="#fileuu" class="btn btn-default active" data-toggle="tab">
                    <input type="radio" class="changev" value="1">File Upload
                </a>
                <a href="#urluu" class="btn btn-default" data-toggle="tab">
                    <input type="radio" class="changev" value="2">URL upload
                </a>
                <a href="#linkuu" class="btn btn-default" data-toggle="tab">
                    <input type="radio" class="changev" value="3">Website Link
                </a>
            </div>
            <div class="tab-content">
                <div class="tab-pane active" id="fileuu">
                    <label for="comment">Click below to choose files:</label>
                    <input type="file" name="file[]" multiple id="input" class="file_input">
                </div>
                <div class="tab-pane" id="urluu">
                    <label for="comment">Image Urls to Compress:</label>
                    <textarea class="form-control" rows="2" name="urls" id="urls"></textarea>
                </div>
                <div class="tab-pane" id="linkuu">
                    <label for="comment">Website URL to Analyze:</label>
                    <textarea class="form-control" rows="2" name="file[]" id="urls"></textarea>
                </div>
            </div>
            <div class="alert alert-warning" role="alert" id="loading_progress"></div>
            <br>
            <input type="submit"
                   value="Compress »"
                   class="btn btn-primary btn-lg pull-right"
                   id="upload_btn"
                   name="upload_btn">
            <input type="hidden" name="fileorurl" id="myField" value="">
        </form>
    </div>
</div>

Here is javascript:
<script>
    $('.changev').change(function () {
        var valueuu = $(this).val();
        $("#myField").val(valueuu);
    });
</script>

Any help will be useful thanks!

A:

Your checkboxes not updating for some strange reason after a few clicks. You can use the click event on their parents instead:
$('#tab a').on('click', function(){
    var valueuu = $(this).find('input').val(); 
    $("#myField").val(valueuu);
});

Fiddle

