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.
2 1817
You only need to include the relevant code.
You've supplied too much.
Heres the relevant code i think where the change needs to be done.
This is the code for drop down box. -
<?php
-
-
require "config.php"; // database connection details
-
echo "
-
-
function fillQualification(){
-
// this function is used to fill the Qualification list on load
-
-
";
-
-
$q1=mysql_query("select * from qualification");
-
echo mysql_error();
-
while($nt1=mysql_fetch_array($q1)){
-
echo "addOption(document.form1.Qualification, '$nt1[QualificationId]', '$nt1[QualificationName]');";
-
}// end of while
-
?>
-
} // end of JS function
-
-
function SelectSpecial(){
-
// ON or after selection of qualification this function will work
-
-
removeAllOptions(document.form1.Specialization);
-
addOption(document.form1.Specialization, "", "-Select-", "");
-
-
// Collect all element of Specialization for various QualificationId
-
-
<?php
-
// let us collect all QualificationId and then collect all Specialization for each QualificationId
-
$q2=mysql_query("select distinct(QualificationId) from specialization");
-
// In the above query you can collect QualificationId from qualification table also.
-
while($nt2=mysql_fetch_array($q2)){
-
echo "if(document.form1.Qualification.value == '$nt2[QualificationId]'){";
-
$q3=mysql_query("select SpecializationArea from specialization where QualificationId='$nt2[QualificationId]'");
-
while($nt3=mysql_fetch_array($q3)){
-
echo "addOption(document.form1.Specialization,'$nt3[SpecializationId]', '$nt3[SpecializationArea]');";
-
-
-
} // end of while loop
-
echo "}"; // end of JS if condition
-
-
}
-
?>
-
}
-
This is the insert statement from where the details go in database. -
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]')")
-
or die(mysql_error());
-
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
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" %>
...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
| |