Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 24th, 2007, 04:35 AM
Registered User
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default add a new row when cursor comes to the last field

Im developing package in ASP.
Wherein i have a row & i have the following details
ID, Name, City, Country.

if the cursor comes to country (on the lost focus event) i have to add another row which should allow me to enter another customers details (ID, Name, City, Country).

So, by default i should have only one row & once it comes to country. Another row should be displayed.

I hope i have not confused in sentence what i have put accrossed.

Need this @ the earliest.


Old February 26th, 2007, 07:11 AM
Friend of Wrox
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919

Hii BullsB!!

You can track the user input on the last field (i.e country)
row1>Id, Name , City ,Country (lost focus 2nd row inserted)
row2>Id, Name , City ,Country (lost focus 3rd row inserted)
row3>Id, Name , City ,Country

Now i am going to change the details of first row ,it will automatically insert new row while new row is already added ,its not good idea to put event-control at the last textbox.

one of the best practice says, create two buttons(eg. Add,Remove)
put hidden counter for number of rows currently added.

If user clicks on the Add button just add new row at the end and remove if he/she clicks on the Remove button.Also you can use Ignore(checkbox) so that if user want to discard middle row and wants to insert data of 1 and 3 rd row.

It's up to ur requirement.
Hope this will help you

Cheers :)

Old February 26th, 2007, 11:26 PM
Registered User
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks vinod...I got that now...

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move cursor to beginning of field in form Odeh Naber Access 3 June 5th, 2007 04:21 PM
add a new row when cursor comes to the last field bullsb Classic ASP Professional 8 March 11th, 2007 04:11 PM
Want to pass a row cursor to a function in a query howardb1 Access VBA 0 April 24th, 2006 03:24 PM
Force cursor to next field dbartelt Access 2 June 21st, 2005 08:37 AM
position cursor at certain field on user form kliu9 Excel VBA 1 January 21st, 2005 06:51 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.