SQL, Javascript And Asp Gurus, Fall Out! - Webmasters - Nairaland
Nairaland Forum › Science/Technology › Webmasters › SQL, Javascript And Asp Gurus, Fall Out! (507 Views)
1 Reply
| SQL, Javascript And Asp Gurus, Fall Out! by epospiky(op): 9:40pm On Aug 11, 2016 |
Hello there! I am a web developer - just started learning though. I am presently creating an information system using SQL database. I have built the application in Visual Studio using Asp.net. I have entered some data in my database and I want some of the options or data to come up automatically in a field when I select a particular option from another field. For example, when I run my program and I select car as an option in the VEHICLE field, the BRAND field should be able to generate automatically from the database and allow the user to choose. If I select MOTORCYCLE as the vehicle then different brands of the motorcycle should be able to automatically generate in the BRAND field. There is already a relationship between the two fields and dependency as well. I was meant to understand that it can be achieved using JavaScript but I don't know how. Please anyone with an idea should help me out. |
| Re: SQL, Javascript And Asp Gurus, Fall Out! by webdeveloperqx: 7:17am On Aug 12, 2016 |
YES, a javascript library JQuery will do the work using its ajax method or better still using javascript XMLHTTPREQUEST OBJECT. if you using ajax, you will have to listen to an event , in your case when the selected value changes , then you send the variable name via AJAX to display values by making calls to your database to display information matching what was selected. an example is below, make sure you have jquery installed or linked on your webpage from a CDN. <script> $( document ).ready( function(){ var selected = "listen to an event( check for your event here )"; $.ajax: { action: "link to your php file where response will be availabe ( database querries here )"; 'product name' : selected; //pass the variable selected in the field> } //display the response function devx_ajax_response(response){ document.getElementById('brand').HTML= response; } }); </script> I hope this walks you through and helps. if you need a full script written for you , email webdeveloperqx@gmail.com or put a call to : 09092882430. happy coding. |
| Re: SQL, Javascript And Asp Gurus, Fall Out! by godofbrowser(m): 12:09pm On Aug 12, 2016 |
VANILLA JAVASCRIPT Copy the code below and save it in a [dot]html file and see exactly how it works. I believe this will give you a good understanding of the process. change the selected item to see an example<br> |
Self Study Materials For Oracle OCA And Asp.net • ASP And ASP.NET With Our Windows VPS • 2 • 3 • 4
Blog Secretes, Adsense Hacks, Making Money Online Etc enter here • How To Boost Your Blog's Traffic By 60% • Guys I Need Working Online Mp3 Tag Editor Drop Yours
;