...

View Full Version : urgent help in javascript form fileds



nagakiran
08-20-2010, 08:36 PM
Hi ,

I have 4 input form fields and when user enters data in any number of fields like he enter data in 2 fields and left 2 fields blank like(123, ,456, ,), i need to check on blur event so that it has to check for empty fields and once empty fields exits then it has to sort out all the data presented fields and then placed back to input fields like (456,123, , ,).

i am new to java script and i have no idea how to implement this , please help me thanks.


<input type="text"
name="itemMod1_1"
size="5"
maxlength="5"
class="mono" >
<input type="text"
name="itemMod2_1"
size="5"
maxlength="5"
class="mono" >
<input type="text"
name="itemMod3_1"
size="5"
maxlength="5"
class="mono" >
<input type="text"
name="itemMod4_1"
size="5"
maxlength="5"
class="mono" >

Philip M
08-20-2010, 08:46 PM
I have 4 input form fields and when user enters data in any number of fields like he enter data in 2 fields and left 2 fields blank like(123, ,456, ,), i need to check on blur event so that it has to check for empty fields and once empty fields exits then it has to sort out all the data presented fields and then placed back to input fields like (456,123, , ,).



Clear as mud! :( Are you saying that if two fields are left blank, the data entered in the remaining two fields is to be placed in Field1, Field2 (in descending numerical order), and so on (leaving Field3 and Field4 blank)? Is all the input data numeric? And you cannot really check if a field is blank with onblur() as it may never have received focus!

You really must express yourself more clearly if we are to unravel your problem.


It is your responsibility to die() if necessary….. - PHP Manual



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum