value not going in data base


Posted on 16th Feb 2014 07:03 pm by admin

hello friends....
i am having a working javascript....when i am selecting any designation and refresh/validation problem the form is resetting the designation value and the designation value is not going into the database.....please look at the below code and suggest me how to make it work...

Code: [Select]function changeList(list1,list2) {
list2.length = 0;
if(list1.options[list1.selectedIndex].value == 2)
{
addOption(list2,"ACTD","ACTD"); addOption(list2,"ALEC","ALEC"); addOption(list2,"ASOP","ASOP"); addOption(list2,"ASTP","ASTP");
addOption(list2,"DIRO","DIRO"); addOption(list2,"DLIB","DLIB");addOption(list2,"LECT","LECT"); addOption(list2,"PFAT","PFAT");
addOption(list2,"PROF","PROF");addOption(list2,"TA","TA"); addOption(list2,"VFAC","VFAC"); addOption(list2,"VPRF","VPRF");
}
else if(list1.options[list1.selectedIndex].value == 3)
{
addOption(list2,"ACCO","ACCO"); addOption(list2,"APRG","APRG"); addOption(list2,"ASTR","ASTR"); addOption(list2,"COCH","COCH");
addOption(list2,"CSHR","CSHR"); addOption(list2,"CTOR","CTOR"); addOption(list2,"DRVR","DRVR"); addOption(list2,"DUDT","DUDT");
addOption(list2,"ELER","ELER"); addOption(list2,"FINO","FINO"); addOption(list2,"HSPT","HSPT"); addOption(list2,"JAAT","JAAT");
addOption(list2,"JOAT","JOAT"); addOption(list2,"JTEC","JTEC"); addOption(list2,"LABT","LABT"); addOption(list2,"LBST","LBST");
addOption(list2,"LIST","LIST");addOption(list2,"MEDA","MEDA"); addOption(list2,"MO","MO"); addOption(list2,"OFST","OFST");
addOption(list2,"PA","PA");addOption(list2,"PAST","PAST");addOption(list2,"PRGR","PRGR"); addOption(list2,"SCOP","SCOP");
addOption(list2,"SLAT","SLAT"); addOption(list2,"SMDA","SMDA"); addOption(list2,"SMDO","SMDO"); addOption(list2,"SNRS","SNRS");
addOption(list2,"STCH","STCH");addOption(list2,"SUPV","SUPV"); addOption(list2,"WSPT","WSPT");
}
else if(list1.options[list1.selectedIndex].value == 4)
{
addOption(list2,"ATDT","ATDT");addOption(list2,"CHWK","CHWK");
addOption(list2,"LIDT","LIDT"); addOption(list2,"NRSE","NRSE");
addOption(list2,"OAST","OAST");
}
}
</script>
Code: [Select]<body bgcolor="#cccccc" style="color:#000099" onload="changeList(document.forms.form2.emptyp,document.forms.form2.desig)" >

<label>3. Employee Type</label>
<font color="##FF0000" >*</font>
<select name="emptyp" onChange="changeList(document.forms.form2.emptyp,document.forms.form2.desig)">
<option value="2" <?php if (isset($_POST['emptyp']) && $_POST['emptyp'] == '2') { echo "selected='selected'"; }?> >2 (Teaching faculty)</option>
<option value="3" <?php if (isset($_POST['emptyp']) && $_POST['emptyp'] == '3') { echo "selected='selected'"; }?> >3 (Supporting staff)</option>
<option value="4" <?php if (isset($_POST['emptyp']) && $_POST['emptyp'] == '4') { echo "selected='selected'"; }?> >4 (Helping staff)</option>
</select>



<label >9. Designation</label>
<select name="desig" id="desig" value=""> </select>



Code: [Select]$desig=($_POST['desig']);

No comments posted yet

Your Answer:

Login to answer
186 Like 51 Dislike
Previous forums Next forums
Other forums

keeps going back to index.html ???????
ok so i started making my site using mostly.html files now i have added a fair chunk of php. My inde

delete comma
HI,

How to delete "," at the end of the string.
Code: $match = 2009/02/03/a2corr

Error with login script
I am getting an error with my login script:

Error:
Code: Warning: Cannot modify header inf

Multidimensional Array into an Html table, help!
Hello all, I am new to HTML/PHP so any help would be great.

I have a multidimensional array f

Storing user data help?
Hey Guys,

I'm not use if this question is to broad but I can always give you more informatio

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

how can we add data from dynamic fields to mysql db in php
i have a script which i found on the internet. i modify that script according to my needs. what is i

Filename and Line Number Custom Error
I have a class, with a method that accepts 2 parameters. I would like to output error messages.

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

Operating System
How in PHP or other language can I detect Operating system, ie Windows XP Home, Windows 7 Ultimate,

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash