Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    urgent help in javascript form fileds

    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" >

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,919
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Quote Originally Posted by nagakiran View Post

    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
    Last edited by Philip M; 08-20-2010 at 07:49 PM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •