Solution:
<input type="text"
id="projectname" onkeydown="if (event.keyCode == 13)
document.getElementById('btnregister').click()"
/>
<select id="ctype" style="width:206px"><option>Select</option></select>
<script type="text/javascript"
>
function addOption(selectbox, text, value) {
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
for (var i = 0; i < 100; ++i) {
addOption(ctype, "YOUR TEXT","YOUR VALUE");
}
</script>
var date = "24/09/2012";
var datearray = date.split("/");
var newdate = datearray[1] + '/' + datearray[0] + '/' + datearray[2];
newdate will contain 09/24/2012. The split method will split the
string wherever it finds a "/", so if the date string was "24/9/2012",
it would still work and return 9/24/2012.var html =; html.head.title = "My Page Title"; html.body.@bgcolor = "#e4e4e4"; html.body.form.@name = "myform"; html.body.form.@action = "someurl.jss"; html.body.form.@method = "post"; html.body.form.@onclick = "return somejs();"; html.body.form.input[0] = ""; html.body.form.input[0].@name = "test"; Print(html.toXMLString());