How to return 2 values in browse button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi all,

On click on the browse button, usually it will return 1 value (which value
to be pointed). But here, i need to return two value. Let say a code and it's
description. Usually when you click on the code, the code will be returned,
but here i need both the code and it's description to be returned.

Can anyone help me, thanks..
 
Hi,

here's the coding example. when you click the browse button, it will open a
new page. there you can select the code.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>SMART</title>
<script language="JavaScript1.2">

function BranchList(cntrlname){

//alert("inside BranchList")

execfile="../scripts/mgrqispi.dll?APPNAME=SMARTWeb&PRGNAME=BranchList&ARGUMENTS=Branch&Branch="+cntrlname;

//alert(execfile)

showBox=window.open(execfile,"BranchList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if (showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}
}

function ClassList(cntrlname){

//alert("inside ClassList")

execfile="../scripts/mgrqispi.dll?APPNAME=SMARTWeb&PRGNAME=ClassList&ARGUMENTS=Course&Course="+cntrlname;

//alert(execfile)

showBox=window.open(execfile,"ClassList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if (showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}
}

function MajorList(cntrlname){

//alert("inside MajorList")

execfile="../scripts/mgrqispi.dll?APPNAME=SMARTWeb&PRGNAME=MajorList&ARGUMENTS=Major&Major="+cntrlname;

//alert(execfile)

showBox=window.open(execfile,"MajorList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if (showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}

}

</script>


</head>
<BODY background="" marginheight=0 leftmargin=0 bgcolor="#FFFFFF">

<form method="POST" name="AdmissionCourse" action="../scripts/mgrqispi.dll">
<input type="hidden" name="APPNAME" value="SMARTWeb">
<input type="hidden" name="PRGNAME" value="AdmissionCourse">
<input type="hidden" name="ARGUMENTS"
value="Counter,StudNo,StudICNo,StudName,Branch,CourseCode,MajorCode,School,ProcType">
<input type="hidden" name="COUNTER" value="<!$MG_Counter>">
<input type="hidden" name="ProcType" value="S">

<table cellpadding="0" cellspacing="0" border="0" width="1092"
bgcolor="#eeeeee" height="100">
<tr>
<td bgcolor="#FFFFFF" valign="middle" align="left" width="1092" height="22"
colspan="10"><img border="0" src="../SWImages/ani_htp2.GIF" width="128"
height="103" align="left"><IMG SRC="../SWImages/navbar5.jpg" width=715
height=102 BORDER=0 align="left"><img border="0" src="../SWImages/lomak.bmp"
width="134" height="104" align="left"></td>
</tr>
<tr>
<td width="963" bgcolor=#003366 height="24" align="center">
<p align="center"><b><strong><font face="Arial" size=+1
color="#000000"> </font><font face="Arial" size="4" color="#FFFFFF">
-Applied Information Maintenance-</font></strong></b></p>
</td>
</tr>
</table>

<table border="1" width="950" cellpadding="0" bgcolor="#eeeeee"
cellspacing="0" style="border-collapse: collapse" bordercolor="#eeeeee">
<tr><td align="center" width="772">

<tr>
<td width="100%" align="center" height="25" bgcolor="#FFFFFF">
<p align="center"><font face="Arial"
size="2"><b><!$MG_StudName> <!$MG_StudNo></b></font></p></td>
</tr>

<table border="1" width="951" cellpadding="0" bgcolor="#eeeeee"
cellspacing="0" height="25" style="border-collapse: collapse"
bordercolor="#FFFFFF">
<tr>
<td bgcolor="#FFFFFF" width="93" bordercolor="#FFFFFF"><font
class="pn-normal"><span class="message-centre">
<img src="../SWImages/tab_info_selected.gif" alt="Class Information"
border=0 width="91" height="20"></td>
<td bgcolor="#FFFFFF" width="97" bordercolor="#CCCCCC"><img
src="../SWImages/tab_subject_unselected.gif" alt="Class Information" border=0
width="95" height="20"></td>
<td bgcolor="#FFFFFF" width="98" bordercolor="#CCCCCC"><img
src="../SWImages/tab_Guardian_unselected.gif" alt="Class Information"
border=0 width="96" height="20"></td>
<td bgcolor="#FFFFFF" width="97" bordercolor="#CCCCCC"><img
src="../SWImages/tab_Prevexam_unselected.gif" alt="Class Information"
border=0 width="95" height="20"></td>
<td bgcolor="#FFFFFF" width="10" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="11" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="97" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="10" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="418" bordercolor="#FFFFFF"> </td>
</tr>

<div align="left">

<table border="0" width="950" cellpadding="0" cellspacing="1" height="105"
bgcolor="#eeeeee">
<tr>
<td width="885" colspan=4 align="center" height="24" bgcolor="#CCCCFF">
<p align="center"><font face="Arial" size="2"><b>Personal
Information</b></font></p></td>
</tr>

<tr>
<td height="28" width="168">
<p align="right">Applicant No :</td>
<td height="28" width="371"><!$MG_StudNo></td>
<td height="28" width="85">
<p align="right">NRIC No :</p></td>
<td height="28" width="278"><!$MG_StudICNo></td>
</tr>

<tr>
<td height="36" width="168">
<p align="right">Name :</p></td>
<td height="36" width="371"><!$MG_StudName></td>
</tr>
</table>


<table border="0" width="950" cellpadding="0" cellspacing="1" height="230"
bgcolor="#eeeeee">
<tr>
<td width="885" colspan=4 align="center" height="13" bgcolor="#CCCCFF">
<p align="center"><b><font face="Arial"
size="2">Applied</font></b><font face="Arial" size="2"><b>
Information</b></font></p></td>
</tr>

<tr>
<td height="1" width="174">
<p align="right"><font face="Arial" size="2">Branch Applied
:</font></p></td>
<td height="1" width="759">
<span class="message-centre"><font class="pn-normal"><input type="text"
name="Branch" size="22" value="<!$MG_Branch>"><input type="button"
value="Browse"
onClick="BranchList('document.AdmissionCourse.Branch')"></font></span>
</tr>

<tr>
<td height="11" width="174">
<p align="right"><font face="Arial" size="2">Course Applied
:</font></p></td>
<td height="11" width="759">
<span class="message-centre"><font class="pn-normal"><input type="text"
name="CourseCode" size="22" value="<!$MG_CourseCode>"><input type="button"
value="Browse"
onClick="ClassList('document.AdmissionCourse.CourseCode')"></font></span></td>
</tr>

<tr>
<td height="11" width="174">
<p align="right"><font face="Arial" size="2">Major Applied
:</font></p></td>
<td height="11" width="759">
<span class="message-centre"><font class="pn-normal"><input type="text"
name="MajorCode" size="22" value="<!$MG_MajorCode>"><input type="button"
value="Browse"
onClick="MajorList('document.AdmissionCourse.MajorCode')"></font></span></td>
</tr>


<tr><td height="1" width="945" colspan="4"><hr align="left"
size="4"></td></tr>

<tr><td height="27" width="885" colspan="4"><p align="center">
<input type=submit value="Save & Next" name="B1"> <input type=reset
value="Reset" name="B2"></p>
</td></tr>
</table>
</div>
</td>
</tr>
<tr><td width="896"> </td></tr>
</body>

</html>

_____________________________________________________________________
 
From a beginner

If your browse button is this
<input type="button"
value="Browse"
onClick="BranchList('document.AdmissionCourse.Branch')">

wouldn't you be able do one of two things
1) Pass 2 parameters to the function BranchList and then use parameter2 in
the function
onClick="BranchList('document.AdmissionCourse.Branch' , 'parameter2')">

2) Perform 2 actions onClick
onClick="BranchList('document.AdmissionCourse.Branch') ; action2">
where action2 is another function

Perhaps I am missing something here
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

ljack said:
Hi,

here's the coding example. when you click the browse button, it will open
a
new page. there you can select the code.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>SMART</title>
<script language="JavaScript1.2">

function BranchList(cntrlname){

//alert("inside BranchList")

execfile="../scripts/mgrqispi.dll?APPNAME=SMARTWeb&PRGNAME=BranchList&ARGUMENTS=Branch&Branch="+cntrlname;

//alert(execfile)

showBox=window.open(execfile,"BranchList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if (showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}
}

function ClassList(cntrlname){

//alert("inside ClassList")

execfile="../scripts/mgrqispi.dll?APPNAME=SMARTWeb&PRGNAME=ClassList&ARGUMENTS=Course&Course="+cntrlname;

//alert(execfile)

showBox=window.open(execfile,"ClassList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if (showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}
}

function MajorList(cntrlname){

//alert("inside MajorList")

execfile="../scripts/mgrqispi.dll?APPNAME=SMARTWeb&PRGNAME=MajorList&ARGUMENTS=Major&Major="+cntrlname;

//alert(execfile)

showBox=window.open(execfile,"MajorList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if (showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}

}

</script>


</head>
<BODY background="" marginheight=0 leftmargin=0 bgcolor="#FFFFFF">

<form method="POST" name="AdmissionCourse"
action="../scripts/mgrqispi.dll">
<input type="hidden" name="APPNAME" value="SMARTWeb">
<input type="hidden" name="PRGNAME" value="AdmissionCourse">
<input type="hidden" name="ARGUMENTS"
value="Counter,StudNo,StudICNo,StudName,Branch,CourseCode,MajorCode,School,ProcType">
<input type="hidden" name="COUNTER" value="<!$MG_Counter>">
<input type="hidden" name="ProcType" value="S">

<table cellpadding="0" cellspacing="0" border="0" width="1092"
bgcolor="#eeeeee" height="100">
<tr>
<td bgcolor="#FFFFFF" valign="middle" align="left" width="1092"
height="22"
colspan="10"><img border="0" src="../SWImages/ani_htp2.GIF" width="128"
height="103" align="left"><IMG SRC="../SWImages/navbar5.jpg" width=715
height=102 BORDER=0 align="left"><img border="0"
src="../SWImages/lomak.bmp"
width="134" height="104" align="left"></td>
</tr>
<tr>
<td width="963" bgcolor=#003366 height="24" align="center">
<p align="center"><b><strong><font face="Arial" size=+1
color="#000000"> </font><font face="Arial" size="4" color="#FFFFFF">
-Applied Information Maintenance-</font></strong></b></p>
</td>
</tr>
</table>

<table border="1" width="950" cellpadding="0" bgcolor="#eeeeee"
cellspacing="0" style="border-collapse: collapse" bordercolor="#eeeeee">
<tr><td align="center" width="772">

<tr>
<td width="100%" align="center" height="25" bgcolor="#FFFFFF">
<p align="center"><font face="Arial"
size="2"><b><!$MG_StudName> <!$MG_StudNo></b></font></p></td>
</tr>

<table border="1" width="951" cellpadding="0" bgcolor="#eeeeee"
cellspacing="0" height="25" style="border-collapse: collapse"
bordercolor="#FFFFFF">
<tr>
<td bgcolor="#FFFFFF" width="93" bordercolor="#FFFFFF"><font
class="pn-normal"><span class="message-centre">
<img src="../SWImages/tab_info_selected.gif" alt="Class Information"
border=0 width="91" height="20"></td>
<td bgcolor="#FFFFFF" width="97" bordercolor="#CCCCCC"><img
src="../SWImages/tab_subject_unselected.gif" alt="Class Information"
border=0
width="95" height="20"></td>
<td bgcolor="#FFFFFF" width="98" bordercolor="#CCCCCC"><img
src="../SWImages/tab_Guardian_unselected.gif" alt="Class Information"
border=0 width="96" height="20"></td>
<td bgcolor="#FFFFFF" width="97" bordercolor="#CCCCCC"><img
src="../SWImages/tab_Prevexam_unselected.gif" alt="Class Information"
border=0 width="95" height="20"></td>
<td bgcolor="#FFFFFF" width="10" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="11" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="97" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="10" bordercolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF" width="418" bordercolor="#FFFFFF"> </td>
</tr>

<div align="left">

<table border="0" width="950" cellpadding="0" cellspacing="1"
height="105"
bgcolor="#eeeeee">
<tr>
<td width="885" colspan=4 align="center" height="24"
bgcolor="#CCCCFF">
<p align="center"><font face="Arial" size="2"><b>Personal
Information</b></font></p></td>
</tr>

<tr>
<td height="28" width="168">
<p align="right">Applicant No :</td>
<td height="28" width="371"><!$MG_StudNo></td>
<td height="28" width="85">
<p align="right">NRIC No :</p></td>
<td height="28" width="278"><!$MG_StudICNo></td>
</tr>

<tr>
<td height="36" width="168">
<p align="right">Name :</p></td>
<td height="36" width="371"><!$MG_StudName></td>
</tr>
</table>


<table border="0" width="950" cellpadding="0" cellspacing="1" height="230"
bgcolor="#eeeeee">
<tr>
<td width="885" colspan=4 align="center" height="13"
bgcolor="#CCCCFF">
<p align="center"><b><font face="Arial"
size="2">Applied</font></b><font face="Arial" size="2"><b>
Information</b></font></p></td>
</tr>

<tr>
<td height="1" width="174">
<p align="right"><font face="Arial" size="2">Branch Applied
:</font></p></td>
<td height="1" width="759">
<span class="message-centre"><font class="pn-normal"><input type="text"
name="Branch" size="22" value="<!$MG_Branch>"><input type="button"
value="Browse"
onClick="BranchList('document.AdmissionCourse.Branch')"></font></span>
</tr>

<tr>
<td height="11" width="174">
<p align="right"><font face="Arial" size="2">Course Applied
:</font></p></td>
<td height="11" width="759">
<span class="message-centre"><font class="pn-normal"><input type="text"
name="CourseCode" size="22" value="<!$MG_CourseCode>"><input type="button"
value="Browse"
onClick="ClassList('document.AdmissionCourse.CourseCode')"></font></span></td>
</tr>

<tr>
<td height="11" width="174">
<p align="right"><font face="Arial" size="2">Major Applied
:</font></p></td>
<td height="11" width="759">
<span class="message-centre"><font class="pn-normal"><input type="text"
name="MajorCode" size="22" value="<!$MG_MajorCode>"><input type="button"
value="Browse"
onClick="MajorList('document.AdmissionCourse.MajorCode')"></font></span></td>
</tr>


<tr><td height="1" width="945" colspan="4"><hr align="left"
size="4"></td></tr>

<tr><td height="27" width="885" colspan="4"><p align="center">
<input type=submit value="Save & Next" name="B1"> <input type=reset
value="Reset" name="B2"></p>
</td></tr>
</table>
</div>
</td>
</tr>
<tr><td width="896"> </td></tr>
</body>

</html>

_____________________________________________________________________


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
I think you are asking how to decide on different browse option when
someone clicks one of three "browse" buttons.

If you assign all three "browse" buttons the same name (i.e. "browse")
but each a different value (instead of "browse" for all, say "Browse
Course", "Browse Branch", "Browse Major"), then on your response
function or response page you can retrieve the value for the name of the
button and decide what to do based on which of the three values it has.


....PC
 
Back
Top