Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add/Delete from a list

Status
Not open for further replies.

WorkSuxs

Programmer
Jan 26, 2005
28
US
Hi, I have a page that I want users to add a number to a "list" that is disypled on the page. They enter the number into a text box and click a button that will add the number to the "list" on the page (without refreshing). I need to be able to delete one or poss more than one number from the list, by way of another button. Is there a way of doing this? The powers to be don't want the page refreshed...
 
Not to be a pain, but since ASP is the server-side portion and you don't want to refresh the page, you may want to try in a more appropriate forum such as the javascript forum.
This may even be in the FAQs over there, since it is a fairly common thing that gets asked.

barcode_1.gif
 
Thanks, I was affraid of that. Since we only program in Vbscript....
 
How do you store the numbers?
Why can't you refresh your page?

[blue]Go to work to learn. Don't go to work to earn.[/blue]
 
My boss does not like page refreshes. I'm trying to figure out how to do this. So right now, I'm not storing them at all.
 
What you could do is create a textbox and when you click the button - store the textbox's contents in a local variable from the Request object's Form collection.

Like:
myString = Request.Form( "SomeTextbox" )

And keep concatenating that variable with future textbox entries:

conString = conString & "<br>" & myString

Your conString variable would look like:
"Mike<br>Joe<br>Tim<br>"

So in HTML it would look like:
Mike
Joe
Tim

Then use the Replace Function to get rid of the last "<br>"
FinalString = Replace( conString, Right( conString, 4 ), "" )






[blue]Go to work to learn. Don't go to work to earn.[/blue]
 
Hmmm .. nevermind .. I suppose that didn't answer your question.

[blue]Go to work to learn. Don't go to work to earn.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top