I want to add "https://" to a form on submission, without it appearing the text submission box. So far I have a script:
<script>
function formSubmit(){
var x=document.getElementById(“formname”);
for (var i=0;i<x.length;i++){
if(x.elements.item(i).id == 'q' && x.elements.item(i).value != "" )
x.elements.q.value='https://'+x.elements.item(i).value;
document.getElementById("formname").submit();
}
</script>
and the form:
<form name="formname" method="GET" action="http://google.com/search" onsubmit="return (this.q.value == '') ? false : true; >
<input type="text" name="q" size="32" maxlength="256" value="" />
<input type="submit" name="btnG" value="Search" />
but can't figure it out. anybody see what I'm doing wrong?