lword
asked on
how to retain a value (which is assigned from the url) while submitting the page(using php)
iam assigning two values say clientid and jobid from the url to the page.After all the details have entered and while saving the page the clientid and jobid becomes nothing.the problem is to retain the value when the page gets saved.
how to solve this ?
how to solve this ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
it seems that sajuks comment is correct.
However, if you need further help, the only way is to post you code here for EE perusal and possible correction and advice!
However, if you need further help, the only way is to post you code here for EE perusal and possible correction and advice!
ASKER
i have give the code below:
<html>
<head>
<title></title>
<script language="JavaScript">
<!--
function ValidateOnSubmit()
{
searchstring = document.artinfo.searchval .value;
LabelSearchString = "Search pattern";
document.artinfo.searchval .value = searchstring;
document.artinfo.hidefetch .value = 'Search';
document.artinfo.changed.v alue = 2;
document.artinfo.ivalue.va lue = "";
document.artinfo.fvalue.va lue = "";
var commun_clientname=document .artinfo.h idclientna me.value;
var commun_jobtitle=document.a rtinfo.hid jobtitle.v alue;
return true;
}
function sortby()
{
document.artinfo.submit();
}
function SaveFunction()
{
RepBackSlash();
LabelSummary ="Communication Summary";
alert('%%%%%%');
commsummary = document.artinfo.commsumma ry.value;
subject=document.artinfo.s ubject.val ue;
commun_jobid=document.arti nfo.hidjob id.value;
peopleid=document.artinfo. hidpeoplei d.value;
document.artinfo.submit();
return true;
}
function CloseDiv()
{
document.all.divpeople.sty le.visibil ity='hidde n';
}
function SelectPeople(peopleid)
{
searchstring=document.arti nfo.hidefe tch.value;
document.artinfo.hidpeople id.value=p eopleid;
document.artinfo.hidcontac tperson.va lue= surname;
document.artinfo.submit();
return true;
}
-->
</script>
</head>
<?
print "<body bgcolor=$mailpagebgcolor topmargin=$bodytopmargin leftmargin=$bodyleftmargin onload='this.focus()'>";
?>
<form name ="artinfo" method ="post" action ="TelecommunCView.php">
<?
print "<tr bgcolor=$mailfeedbackbgcol or><td height=$mainfeedbacktdheig ht>";
print "<font color=$mainfeedbackfontcol or size=$mainfeedbackfontsize face=$mainfeedbackfontface >";
if($ret_accright ==1)
{
print (" <image src=$mainfeedbackimage><b> $Msg AccessRigh ts</b>");
exit;
}
else if($ret_accright ==3 )
{
print(" <image src=$mainfeedbackimage><b> $Msg NotLoggedI n</b>");
exit;
}
//query to display while the search button is submitted
if ($hidefetch == 'Search')
{
$rs_query=pg_exec("select people.people_id,people.su rname,peop le.user_id from people where upper(people.surname) like upper('%$searchval%') order by upper(people.surname)");
$nrows = pg_numrows($rs_query);
}
if(( $hidefetch == 'Search' and $nrows ==0))
{
print ("<image src=$mainfeedbackimage>&nb sp;<b>No Match Found</b>");
}
if($modeofcomm == "3")
{
print "<script>";
print "var sourcepage ='TelecommunCView.php';";
print "</script>";
}
////////////////////HIDDEN VARIABLES DECLARATIONS////////////// /////////
print "<input type=hidden name=hidclientname value='$commun_clientname' >";
print "<input type=hidden name=hidjobtitle value='$commun_jobtitle'>" ;
print "<input type=hidden name=hidefetch value='$hidefetch'>";
print "<input type=hidden name=hidclientid value='$commun_clientid'>" ;
print "<input type=hidden name=hidjobid value='$commun_jobid'>";
print "<input type=hidden name=divclose>";
print "<input type=hidden name=hidcontactperson value=$hidcontactperson>";
print "<input type=hidden name=hidpeopleid value=$hidpeopleid>";
/////////////////////HEADE R///////// ////////// ////////// ////////// ////
print "<table width=100% border='0' align=$maintablealign cellpadding=$maintablecell padding cellspacing=$maintablecell spacing>";
print "<tr bgcolor=$mailtitlebgcolor> ";
print "<td id=feedback1 valign=top align=left nowrap colspan=3><font face=$reptabheadfontface size=$reptabheadfontsize>" ;
print " <b>Start TeleCommunication</b>";
print "</td>";
print "</tr>";
print "</table>";
print "<br>";
/////////////////CLIENT NAME////////////////////// ////////// //////
print "<table width=100% border=0 cellpadding=0 cellspacing=0 bordercolor=$reptabfieldbg color align=$reptabtopdisplayali gn>";
print "<tr><td width=10% nowrap id=cid name=cid><font size=$reptabheadfontsize face=$reptabheadfontface>" ;
if ($hidclientname !='')
{
print " Client Name &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp;: $hidclientname</td>";
}
else
{
print " Client Name &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp;: $commun_clientname</td>";
}
print "<td>";
print "<font color=$othertextcolor size=$reptabheadfontsize face=$reptabheadfontface>" ;
print "</td></tr>";
/////////////////PROJECT NAME////////////////////// ////////// //
print "<tr><td width=10% nowrap id=jid name=jid><font size=$reptabheadfontsize face=$reptabheadfontface>" ;print "<br>";
if ($hidjobtitle !='')
{
print " Project Name &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p;: $hidjobtitle</td>";
}
else
{
print " Project Name &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; &nbs p;: $commun_jobtitle</td>";
}
print "<font color=$othertextcolor size=$reptabheadfontsize face=$reptabheadfontface>" ;
print "</tr></table>";
////////////////CONTACT PERSON//////////////////// ////////// /
print "<table width=95% border='0' cellpadding=$maintablecell padding cellspacing=$maintablecell spacing>";
print "<tr>";
print "<td width='25%' name=hidcontactperson align=left id='contperson'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo r>";
print " Contact Person";
print " & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ;: $hidcontactperson";
print "<td width='14%' align=left id='SearchPeopleid'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo r>";
print "<input type=text name='searchval' size=32>";
print " <input type='submit' value='Search' name='fetch' onclick='return ValidateOnSubmit()'>";
print "</font>";
print "</td></tr>";
print "<br>";
print "</tr></td>";
print "</table>";
//print "<br>";
//************************ *******Div for listing all the peoplenames
//************************ ********** ********** ****/
if ($hidefetch !='')
{
if($nrows<17) {$scrollheight2=18*$nrows; }
else{$scrollheight2=300;}
print "<div id='divpeople'
style ='position: absolute;
width: 30%;
height: $scrollheight2;
visibility:visible;
top:20%;
left:60%;
border:1;
z-index:111003;
background-color:$reptabhe adbgcolor;
border:1px outset;'>";
print "<table width=$reptabwidth border=0 cellpadding=$reptabcellpad ding cellspacing=$reptabcellspa cing align=$reptabalign bordercolor='$reptabborder color'>";
print "<td width=50%>";
//print "<tr bgcolor='$reptabheadbgcolo r' id=$Peopleid>";
//print "<td width=30%>";
//print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo r>";
//print "<a href=# title='Select all'>◄</a>";
//print "<b>Select</b>";
//print "</td>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo r> <b> People Name</b></font>";
print "<td width=50% align=right><a href=# onclick='CloseDiv()'><b><f ont size=3 style='background-color:$r eptabfield bgcolor' color='gray'> X </a></font ></b></td> ";
if($nrows>0)
{
for($i=0;$i<$nrows;$i++)
{
$peopleid= pg_result($rs_query,$i,"pe ople_id");
$surname= pg_result($rs_query,$i,"su rname");
$user_id=pg_result($rs_que ry,$i,"use r_id");
//print "<script language='javascript'>
//ArrPeopleNameLookUp[$peo pleid][$nr ows]=peopl eid;
//ArrPeopleNameLookUp[$i]= $peopleid;
//ArrPeopleNameLookUp[$i][ $peopleid] =$surname;
//</script>";
//print "ArrPeopleNameLookUp[$i][$ surname] = $surname";
print "<tr bgcolor='$reptabheadbgcolo r'>";
print "<td width=30% nowrap>";
print "<a title='Select the Contact Person' onclick='return SelectPeople($peopleid)'";
print " href='TelecommunCView.php? hidpeoplei d=".urlenc ode($peopl eid)."&hid contactper son=".urle ncode($sur name)."&hi dclientnam e=".urlenc ode($hidcl ientname). "&hidjobti tle=".urle ncode($hid jobtitle). "&hidclien tid=".urle ncode($hid clientid). "&hidjobid =".urlenco de($hidjob id)."'>";
print " ◄</a><font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo r> $s urname</fo nt></td></ tr>";
}
}
print "</td>";
print "</tr>";
print "</table>";
print "</DIV>";
print "<br>";
}
else
{
print "<div id='divpeople'
style ='position: absolute;
width: 30%;
height: $scrollheight2;
visibility:hidden;
top:20%;
left:60%;
border:1;
z-index:111003;
background-color:$reptabhe adbgcolor;
border:1pz outset;'>";
print "</div>";
}
print "<br>";
/************************* *******End of div*********************** ********** ********** **/
////////////////////FOR SUBJECT/////////////////// /////////
print "<table width=10% border='0' cellpadding=$maintablecell padding cellspacing=$maintablecell spacing>";
print "<tr>";
print "<td width='45%' nowrap align=left id='subject'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo r>";
print " Subject ";
print " & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ; &nb sp; & nbsp;  ; : ";
print "<td width='25%' align=left>";
print " <input type=text value='$subject' name='subject' size=58>";
print "</font></td></tr></table> ";
print "<br>";
//////////////COMMUNICATIO N DETAILS/////////////////// ///
print "<table width=100% border='0' align=$maintablealign cellpadding=$maintablecell padding cellspacing=$maintablecell spacing>";
print "<tr>";
print "<td width=23% align=left colspan='2'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo r>";
print " Enter Communication Details <font size=$asteriskmarksize color=$mandasteriskmarkcol or>*</font > &nb sp; : <br>";
print "</br></td></tr></table>";
print "<tr>";
print "<td>";
if ($hidcontactperson !='')
{
print " <textarea name=commsummary rows=20 cols=90>";
}
else
{
print " <textarea name=commsummary rows=20 cols=70>";
}
print "</textarea>";
print "<br>";
print "</td></tr>";
////////////////SAVE BUTTON//////////////////// /////////
print "<table width='5%' border='0' align='center' cellpadding='0' cellspacing='0' bordercolor='maroon'>";
print "<td width='100%'align=center>" ;
print "<tr><br> ";
print " < input type=submit name=hidsave value='Save'
style='border:1px solid maroon;background-color:$s avebutcolo r; '
onmouseover='document.arti nfo.hidsav e.style.ba ckgroundCo lor=\"$but overcolor\ " ;document.artinfo.hidsave. style.colo r=\"white\ "''
onmouseout='document.artin fo.hidsave .style.bac kgroundCol or=\"$save butcolor\" ; document.artinfo.hidsave.s tyle.color =\"$delfon tcolor\"'
onClick='return SaveFunction();'>";
print "</td></tr></table>";
///newly added function to save the telecommuncations details
//function addTeleComm($hidclientid,$ hidjobid,$ hidpeoplei d,$subject ,$commsumm ary,$id)
//{
//}
print"@@@$hidclientid,$hid jobid";
///save validations
if($hidsave=='Save')
{
if($id=='') {$id=0;}
//if($hidclientid==''){$hi dclientid= 0;}
//if($hidjobid==''){$hidjo bid=0;}
print"&&&$hidclientid,$hid jobid";
$rs_result =pg_exec("select sp_addTeleComm('$hidclient id','$hidj obid','$hi dpeopleid' ,'$subject ','$messag e','$id')" );
print "addTeleComm('$hidclientid ','$hidjob id','$hidp eopleid',' $subject', '$commsumm ary','$id' )";
$ret = pg_result($rs_result,0,0);
return $ret;
/*$a = new add();
print "addTeleComm($hidclientid, $hidjobid, $hidpeople id,$subjec t,$commsum mary,$id)" ;
$ret_add = $a->addTeleComm('$hidclien tid','$hid jobid','$h idpeopleid ','$subjec t','$comms ummary','$ id');
print "$ret_add";
if($ret_add==0)
{
print " <image src=$mainfeedbackimage><b> Tele Communicat ion details were successfully saved</b>";
}*/
}
?>
</form>
</body>
</html>
<html>
<head>
<title></title>
<script language="JavaScript">
<!--
function ValidateOnSubmit()
{
searchstring = document.artinfo.searchval
LabelSearchString = "Search pattern";
document.artinfo.searchval
document.artinfo.hidefetch
document.artinfo.changed.v
document.artinfo.ivalue.va
document.artinfo.fvalue.va
var commun_clientname=document
var commun_jobtitle=document.a
return true;
}
function sortby()
{
document.artinfo.submit();
}
function SaveFunction()
{
RepBackSlash();
LabelSummary ="Communication Summary";
alert('%%%%%%');
commsummary = document.artinfo.commsumma
subject=document.artinfo.s
commun_jobid=document.arti
peopleid=document.artinfo.
document.artinfo.submit();
return true;
}
function CloseDiv()
{
document.all.divpeople.sty
}
function SelectPeople(peopleid)
{
searchstring=document.arti
document.artinfo.hidpeople
document.artinfo.hidcontac
document.artinfo.submit();
return true;
}
-->
</script>
</head>
<?
print "<body bgcolor=$mailpagebgcolor topmargin=$bodytopmargin leftmargin=$bodyleftmargin
?>
<form name ="artinfo" method ="post" action ="TelecommunCView.php">
<?
print "<tr bgcolor=$mailfeedbackbgcol
print "<font color=$mainfeedbackfontcol
if($ret_accright ==1)
{
print (" <image src=$mainfeedbackimage><b>
exit;
}
else if($ret_accright ==3 )
{
print(" <image src=$mainfeedbackimage><b>
exit;
}
//query to display while the search button is submitted
if ($hidefetch == 'Search')
{
$rs_query=pg_exec("select people.people_id,people.su
$nrows = pg_numrows($rs_query);
}
if(( $hidefetch == 'Search' and $nrows ==0))
{
print ("<image src=$mainfeedbackimage>&nb
}
if($modeofcomm == "3")
{
print "<script>";
print "var sourcepage ='TelecommunCView.php';";
print "</script>";
}
////////////////////HIDDEN
print "<input type=hidden name=hidclientname value='$commun_clientname'
print "<input type=hidden name=hidjobtitle value='$commun_jobtitle'>"
print "<input type=hidden name=hidefetch value='$hidefetch'>";
print "<input type=hidden name=hidclientid value='$commun_clientid'>"
print "<input type=hidden name=hidjobid value='$commun_jobid'>";
print "<input type=hidden name=divclose>";
print "<input type=hidden name=hidcontactperson value=$hidcontactperson>";
print "<input type=hidden name=hidpeopleid value=$hidpeopleid>";
/////////////////////HEADE
print "<table width=100% border='0' align=$maintablealign cellpadding=$maintablecell
print "<tr bgcolor=$mailtitlebgcolor>
print "<td id=feedback1 valign=top align=left nowrap colspan=3><font face=$reptabheadfontface size=$reptabheadfontsize>"
print " <b>Start TeleCommunication</b>";
print "</td>";
print "</tr>";
print "</table>";
print "<br>";
/////////////////CLIENT NAME//////////////////////
print "<table width=100% border=0 cellpadding=0 cellspacing=0 bordercolor=$reptabfieldbg
print "<tr><td width=10% nowrap id=cid name=cid><font size=$reptabheadfontsize face=$reptabheadfontface>"
if ($hidclientname !='')
{
print " Client Name &nbs
}
else
{
print " Client Name &nbs
}
print "<td>";
print "<font color=$othertextcolor size=$reptabheadfontsize face=$reptabheadfontface>"
print "</td></tr>";
/////////////////PROJECT NAME//////////////////////
print "<tr><td width=10% nowrap id=jid name=jid><font size=$reptabheadfontsize face=$reptabheadfontface>"
if ($hidjobtitle !='')
{
print " Project
}
else
{
print " Project
}
print "<font color=$othertextcolor size=$reptabheadfontsize face=$reptabheadfontface>"
print "</tr></table>";
////////////////CONTACT PERSON////////////////////
print "<table width=95% border='0' cellpadding=$maintablecell
print "<tr>";
print "<td width='25%' name=hidcontactperson align=left id='contperson'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo
print " Contact
print " &
print "<td width='14%' align=left id='SearchPeopleid'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo
print "<input type=text name='searchval' size=32>";
print " <input type='submit' value='Search' name='fetch' onclick='return ValidateOnSubmit()'>";
print "</font>";
print "</td></tr>";
print "<br>";
print "</tr></td>";
print "</table>";
//print "<br>";
//************************
//************************
if ($hidefetch !='')
{
if($nrows<17) {$scrollheight2=18*$nrows;
else{$scrollheight2=300;}
print "<div id='divpeople'
style ='position: absolute;
width: 30%;
height: $scrollheight2;
visibility:visible;
top:20%;
left:60%;
border:1;
z-index:111003;
background-color:$reptabhe
border:1px outset;'>";
print "<table width=$reptabwidth border=0 cellpadding=$reptabcellpad
print "<td width=50%>";
//print "<tr bgcolor='$reptabheadbgcolo
//print "<td width=30%>";
//print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo
//print "<a href=# title='Select all'>◄</a>";
//print "<b>Select</b>";
//print "</td>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo
print "<td width=50% align=right><a href=# onclick='CloseDiv()'><b><f
if($nrows>0)
{
for($i=0;$i<$nrows;$i++)
{
$peopleid= pg_result($rs_query,$i,"pe
$surname= pg_result($rs_query,$i,"su
$user_id=pg_result($rs_que
//print "<script language='javascript'>
//ArrPeopleNameLookUp[$peo
//ArrPeopleNameLookUp[$i]=
//ArrPeopleNameLookUp[$i][
//</script>";
//print "ArrPeopleNameLookUp[$i][$
print "<tr bgcolor='$reptabheadbgcolo
print "<td width=30% nowrap>";
print "<a title='Select the Contact Person' onclick='return SelectPeople($peopleid)'";
print " href='TelecommunCView.php?
print " ◄</a><font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo
}
}
print "</td>";
print "</tr>";
print "</table>";
print "</DIV>";
print "<br>";
}
else
{
print "<div id='divpeople'
style ='position: absolute;
width: 30%;
height: $scrollheight2;
visibility:hidden;
top:20%;
left:60%;
border:1;
z-index:111003;
background-color:$reptabhe
border:1pz outset;'>";
print "</div>";
}
print "<br>";
/*************************
////////////////////FOR SUBJECT///////////////////
print "<table width=10% border='0' cellpadding=$maintablecell
print "<tr>";
print "<td width='45%' nowrap align=left id='subject'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo
print " Subject
print " &
print "<td width='25%' align=left>";
print " <input type=text value='$subject' name='subject' size=58>";
print "</font></td></tr></table>
print "<br>";
//////////////COMMUNICATIO
print "<table width=100% border='0' align=$maintablealign cellpadding=$maintablecell
print "<tr>";
print "<td width=23% align=left colspan='2'>";
print "<font face=$reptabfieldfontface size=$reptabfieldfontsize color=$reptabfieldfontcolo
print " Enter Communication Details <font size=$asteriskmarksize color=$mandasteriskmarkcol
print "</br></td></tr></table>";
print "<tr>";
print "<td>";
if ($hidcontactperson !='')
{
print " <textarea name=commsummary rows=20 cols=90>";
}
else
{
print " <textarea name=commsummary rows=20 cols=70>";
}
print "</textarea>";
print "<br>";
print "</td></tr>";
////////////////SAVE BUTTON////////////////////
print "<table width='5%' border='0' align='center' cellpadding='0' cellspacing='0' bordercolor='maroon'>";
print "<td width='100%'align=center>"
print "<tr><br> ";
print " <
style='border:1px solid maroon;background-color:$s
onmouseover='document.arti
onmouseout='document.artin
onClick='return SaveFunction();'>";
print "</td></tr></table>";
///newly added function to save the telecommuncations details
//function addTeleComm($hidclientid,$
//{
//}
print"@@@$hidclientid,$hid
///save validations
if($hidsave=='Save')
{
if($id=='') {$id=0;}
//if($hidclientid==''){$hi
//if($hidjobid==''){$hidjo
print"&&&$hidclientid,$hid
$rs_result =pg_exec("select sp_addTeleComm('$hidclient
print "addTeleComm('$hidclientid
$ret = pg_result($rs_result,0,0);
return $ret;
/*$a = new add();
print "addTeleComm($hidclientid,
$ret_add = $a->addTeleComm('$hidclien
print "$ret_add";
if($ret_add==0)
{
print " <image src=$mainfeedbackimage><b>
}*/
}
?>
</form>
</body>
</html>
You need to keep forwaring the hidden values to the next pages.
for ex:
in ur first page from ur query sting you've assigned the two values to a hidden fiedld clientid and jobid.
now when you submit this page the on the second page you can refer to this value as
$hidden1 = $_POST[clientid];
$hidden2 = $_POST[jobid];
now if you are submitting this page agin then like in the first page you need to have the values of $hidden1 and $hidden2 carried forward .
for ex:
in ur first page from ur query sting you've assigned the two values to a hidden fiedld clientid and jobid.
now when you submit this page the on the second page you can refer to this value as
$hidden1 = $_POST[clientid];
$hidden2 = $_POST[jobid];
now if you are submitting this page agin then like in the first page you need to have the values of $hidden1 and $hidden2 carried forward .
it seems to me that the code is there to store keep the value of the hidden field once they are set.
* However, I'm not too sure if the a field is ever set properly
function SelectPeople(peopleid)
{
searchstring=document.arti nfo.hidefe tch.value;
document.artinfo.hidpeople id.value=p eopleid;
document.artinfo.hidcontac tperson.va lue= surname;
document.artinfo.submit();
return true;
}
I reckon the hidcontactperson is never set because surname is not set anywhere in this function
* I'm not too sure if this code is helping as well
////////////////CONTACT PERSON//////////////////// ////////// /
print "<table width=95% border='0' cellpadding=$maintablecell padding cellspacing=$maintablecell spacing>";
print "<tr>";
print "<td width='25%' name=hidcontactperson align=left id='contperson'>";
the td tag has a name identical to the name of your hidden field
* Also you set a number of javascript variable commun_.... and after you reuse them in php as $commun_...
In my mind, javascript is client side and php is server side, therefore this variable can not be used in the same context.
I'm concern that all these issues nneds to be addressed if you want to make sure that everything works as you expect!
Cheers,
Alain
* However, I'm not too sure if the a field is ever set properly
function SelectPeople(peopleid)
{
searchstring=document.arti
document.artinfo.hidpeople
document.artinfo.hidcontac
document.artinfo.submit();
return true;
}
I reckon the hidcontactperson is never set because surname is not set anywhere in this function
* I'm not too sure if this code is helping as well
////////////////CONTACT PERSON////////////////////
print "<table width=95% border='0' cellpadding=$maintablecell
print "<tr>";
print "<td width='25%' name=hidcontactperson align=left id='contperson'>";
the td tag has a name identical to the name of your hidden field
* Also you set a number of javascript variable commun_.... and after you reuse them in php as $commun_...
In my mind, javascript is client side and php is server side, therefore this variable can not be used in the same context.
I'm concern that all these issues nneds to be addressed if you want to make sure that everything works as you expect!
Cheers,
Alain
ASKER
i have used $_POST but it does not retain the value.
is there any other any to solve the problem?
plz.......
is there any other any to solve the problem?
plz.......
sorry as i dont've php installed on this machine i cant be of much help.
Have a look at http://www.codehelp.co.uk/php/form.php#form
in the above example it shows how to read either from a querystring is present or the hidden value depending on what is set.
taht might be of use to you.
and @alain34 has raised some very good points..
Have a look at http://www.codehelp.co.uk/php/form.php#form
in the above example it shows how to read either from a querystring is present or the hidden value depending on what is set.
taht might be of use to you.
and @alain34 has raised some very good points..
ASKER
hai alain34,
This function sets the contactperson value and also all the values inside the selectpeople function.
while saving the savefunction is called and hidsave is set to save,after i print the clientid and jobid then the values are become nothing.
how to retain these values at this stage?
plz................
This function sets the contactperson value and also all the values inside the selectpeople function.
while saving the savefunction is called and hidsave is set to save,after i print the clientid and jobid then the values are become nothing.
how to retain these values at this stage?
plz................
I understand your problem, however your code has prior issues to be solved.
first of all, you should change the selectPeople function to add the 'surname' argument.
you should change the td name with hidcontactperson.
Could you explain to all EE with some variable set in javascript are expected to be used in php?
first of all, you should change the selectPeople function to add the 'surname' argument.
you should change the td name with hidcontactperson.
Could you explain to all EE with some variable set in javascript are expected to be used in php?
send those two values to sessions variables to be retrieved at a later time
ASKER
i will be submitting the page twice.(one is for the search and the other is for save).
while the search button is clicked, i will take the clientid and jobid from the url link.And both the values are assigned.The url will not be there.After i enter the other details to the page and i will save all the details.In this case what happens,the hidden values are set to nothing.how to retain the value in this case and how to solve this?plz tell me its urgent!!!!