Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Refresh list from DB without refreshing entire page

Featured Replies

Greetings!

 

I have a web form I am working on, which has about 50 fields that the user populates. In addition to that I have a multi select drop down that contains song titles from a database. Because there are thousands of songs, I have them broken down into categories based on the type of music/genre.

 

Anyways, I want the customer to be able to change categories within the drop down list without having to refresh the entire page. This would require requerying the DB for that one form field. Is there a way to do this by putting the drop down inside of a <div> or something like that?

 

This form uses ASP/VBScript for connection to a MS Access database.

 

 

Thanks for any help!

That would require AJAX.

Since your project is ASP/VB I asume you are coding in Visual Studio. I belive you can enable client side execution in your properties panel for the dropdown list. Then the select event of the drop down list can execute without refresh. Remember also to enable client side on the element that print the query results and make sure you have a link to jquery in your header.

  • Author

Thanks for the reply. I have a limited scope of knowledge when it comes to web design. I am fairly fluent in VBScript, and know enough about HTML, but very little about Javascript, and nothing about AJAX or jquery, so it sounds like accomplishing this is over my head. I was hoping there would be a way to do it using what I know, but apparently not :(

I have no knowledge on visual basic but I am curretly working with aspx/c# applications and I guess the procedure is the same. If you are using visual studio it's not that hard. All the ajax code is handled by jquery's load method. you can select a theme for you solution with a link to jquery included or add it yourself:

 

 <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

 

Select your dropdownlist and go to the properties panel and enable client-side execution, do the same for the listbox (or whatever element that prints the results).

That should be all. Good luck

Edited by Nillervision

  • Author

Well, I am using Dreamweaver as my code editor, not familiar with visual studio but it appears to be free software so I will have to look into it. Thanks

Visual Studio Express is free to download. I asumed you used it because you need it to execute .net projects (aspx) on a local machine.

Just out of curiosity can you run your VB/ASP applications directly on your local machine or do you need to upload them to a server first?

  • Author

Just out of curiosity can you run your VB/ASP applications directly on your local machine or do you need to upload them to a server first?

 

I have to upload to server first. I will have to give VSE a try.

Hi OP,

Basic solution outline as follows:

  1. Introduce jQuery into your site as it makes writing cross browser JS much easier.
  2. Within a Javascript block in the page attach an 'on change' event to your target select element which in turn calls a new JavaScript function called 'onChangeHandler' or something similar (see: http://api.jquery.com/on/).
  3. In the 'onChangeHandler' function create an AJAX request using jQuery (see: http://api.jquery.com/jQuery.ajax/). The url of the AJAX request will be a new action written in your backend language (in this case ASP). You pass in the parameters from your form in the AJAX request and the response from the ASP action should be the variables you want to pass back to the front-end.
  4. You can then manipulate the response from the serverside in the 'success' portion of the jQuery AJAX call and inject it back into your page.

Best of luck.

Billy

  • Author

Thanks for all of the help everyone. I will look into this and see if I can expand my horizons with web design :)

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.