Hi all,
I have a small HTML form that has a textfeild which when clicked on open a calender, this works fine. I also want to display the selected date in another textfeild using "OnChange". This is what I am working with:
TEXTFEILD
The "OnChange" call a small script:Code:<input name="startDate" type="text" class="bodytext" id="startDate" size="10" maxlength="10" onclick='scwShow(this,this);' onchange="PrintValues3();" target="_parent._top" onmouseclick="this.focus()">
The result2 is then displayed in a textfeild called "result2" but in my case its not.Code:function PrintValues2(){ var myString = document.form1.startDate.value var myStringLength = myString.length var Comma = myString.lastIndexOf(',') var SufNumChars = Comma + 1 document.form1.result2.value=(''); for(i=0; i<Comma; i++) document.form1.result2.value+=(myString.charAt(i)); document.form1.result2.value+=(' '); for(i=SufNumChars; i<myStringLength; i++) document.form1.result2.value+=(myString.charAt(i)); }
Is it possible to use both "OnClick" and "Onchange" together?
Any help would be great.


Reply With Quote

Bookmarks