473,394 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Unable to retrieve id from dropdown

Hi,
Ive made dynamic drop down boxes. On selection of value from first drop down box the values in second drop down are displayed. I ve made this two drop down in a separate file. I want to store the id value of the selected name in the drop down into database. I am able to store the value of first drop down but the value of second drop down is always saved as 0 in the database.
I think its just a small error im am making somewhere. I think the change has to be made on line 232 in insert statement of process.php file
I ve given the code of both my files below plz let me know how it can be fixed.
Attached Files
File Type: txt process.txt (17.0 KB, 947 views)
File Type: txt list.txt (1.7 KB, 258 views)
Mar 12 '08 #1
2 1817
Markus
6,050 Expert 4TB
You only need to include the relevant code.
You've supplied too much.
Mar 12 '08 #2
Heres the relevant code i think where the change needs to be done.
This is the code for drop down box.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. require "config.php"; // database connection details 
  4. echo "
  5.  
  6. function fillQualification(){ 
  7.  // this function is used to fill the Qualification list on load
  8.  
  9. ";
  10.  
  11. $q1=mysql_query("select * from qualification");
  12. echo mysql_error();
  13. while($nt1=mysql_fetch_array($q1)){
  14. echo "addOption(document.form1.Qualification, '$nt1[QualificationId]', '$nt1[QualificationName]');";
  15. }// end of while
  16. ?>
  17. } // end of JS function
  18.  
  19. function SelectSpecial(){
  20. // ON or after selection of qualification this function will work
  21.  
  22. removeAllOptions(document.form1.Specialization);
  23. addOption(document.form1.Specialization, "", "-Select-", "");
  24.  
  25. // Collect all element of Specialization for various QualificationId 
  26.  
  27. <?php 
  28. // let us collect all QualificationId and then collect all Specialization for each QualificationId
  29. $q2=mysql_query("select distinct(QualificationId)  from specialization");
  30. // In the above query you can collect QualificationId from qualification table also. 
  31. while($nt2=mysql_fetch_array($q2)){
  32. echo "if(document.form1.Qualification.value == '$nt2[QualificationId]'){";
  33. $q3=mysql_query("select SpecializationArea from specialization where QualificationId='$nt2[QualificationId]'");
  34. while($nt3=mysql_fetch_array($q3)){
  35. echo "addOption(document.form1.Specialization,'$nt3[SpecializationId]', '$nt3[SpecializationArea]');";
  36.  
  37.  
  38. } // end of while loop
  39. echo "}"; // end of JS if condition
  40.  
  41. }
  42. ?>
  43. }
  44.  
This is the insert statement from where the details go in database.
Expand|Select|Wrap|Line Numbers
  1. mysql_query("INSERT INTO $db_table1(UserName,PhoneNo,MobileNo,YearsExp,MonthsExp,FunctionalArea,KeySkills,Qualification,Specialization,Institute,FunctionalRoles,CurrentEmployer,PreviousEmployers,ProfileTitle,ResumeFile) values ('$_POST[UserName]','$_POST[PhoneNo]','$_POST[MobileNo]','$_POST[YearsExp]','$_POST[MonthsExp]','$_POST[AreaName]','$_POST[KeySkills]','$_POST[Qualification]','$_POST[Specialization]','$_POST[InstituteName]','$_POST[RoleName]','$_POST[CurrentEmployer]','$_POST[PreviousEmployers]','$_POST[ProfileTitle]','$_POST[ResumeFile]')") 
  2. or die(mysql_error());
  3.  
Mar 12 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mr_burns | last post by:
hi there, Ive been having a few problems recently with this group. Im not sure if any of the other groups have been giving me trouble but recently this one has a couple of times, when attempting...
2
by: junky_fellow | last post by:
Hi all, When I try to "post a follow up to some message" I am getting the error "unable to retrieve the messages xxx@xxx.xx.xx". This is the case with all the messages in any of the google...
0
by: Mark | last post by:
Hi, I have a datalist that contains a textbox as well as a dropdown list. For each single row in the datalist the associated dropdown list can have at least one value What I would like to be...
5
by: Joăo Santa Bárbara | last post by:
hi there i have this error in VS2005 DEV Edition "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information." i have create an windows...
2
by: Hugh | last post by:
Naive developer needs help. how to retrieve a dropdown value inside a formview in VB? Is findcontrol the way to go? Thanks in advance. Hugh
0
by: Ambed | last post by:
Hi, I have created a C# application in .Net and then created the setup using .Net and using installer class. Now whenever i am installing that application on a system with Visual Studio...
3
by: bhanubalaji | last post by:
hi, I am unable to disable the text(label) in javascript..it's working fine with IE,but i am using MOZILLA.. can any one help regarding this.. What's the wrong with my code? I am...
3
by: ipramod | last post by:
Hi, I have a code snippet C# when executed gives the following exception on IE. ___________________________________________________________________ Unable to retrieve the user sid from...
1
by: divya | last post by:
Hello, I used the below code to move selected items between two listboxes Left and Right:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPopup.aspx.cs" Inherits="TestPopup" %> ...
1
by: asmith3088 | last post by:
I created a dashboard (two charts) based on six pivot tables whose data is pulled from an Access database. There are dropdowns in the dashboard that are linked to the pivot tables using named ranges...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.