[Answer]-Form submit fails the firstime and works upon refreshing the page

1👍

Your javascript failing.
var combo = document.getElementById(‘selSeaShells1’).value;

Combo is going to be undefined because you are calling load() before the page finishes loading.

I would use jquery and do this:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> //download and get a local copy of jquery don't use googles.***<script>

$(document).ready(function() {
    load();
});

function load()
    {     
        var combo = $('#selSeaShells1 option:selected).val();

            editAreaLoader.init({
            id : "textarea_1"       // textarea id
            ,syntax: combo                // syntax to be uses for highgliting
            ,start_highlight: true      // to display with highlight mode on start-up
            });


    }

</script>

Remove onload=”load();” on body tag
This will get the selection after the page loads.

Leave a comment