Tuesday, January 03, 2006

Javascript : Reassign the old/previous value - when try to submit again

Javascript Desc:

This Script helps to Reassign the old/previous value if the end user filled the empty value in form, when he try to submit again
line1: script language="javascript">
line2: !-- var oldvalue=""; function onfocus_Region(nowValue){
line3: oldvalue=nowValue.value;nowValue.value=""; }
line4: function onblur_Region(nowValue){
line5: } -->
line6: /script>
line7: form name="form1" action="" method="post">
line8: input onblur="javascript:onblur_Region(this);" onfocus="javascript:onfocus_Region(this);" name="textfield">
line9: /form>

Add "<" in the lines.

Adobe News