Hi,

im a new user here .. I have a drop down list that can be customized by user and save the user input for next uses. So that I need to create a table in DB and store user inputs. When user login again, he may able to retrieve his prior inputs through drop down menu. Can someone show me the sample codes for connection DB and retrieving query into drop down list. I haven't tried it before as I'm still new to PERL so that I'll appreciate if you provide a code. Just a sample code will be fine. Thank you in advance.

Here is my code of tmpl:

Code:
 <script LANGUAGE="JavaScript" TYPE="text/javascript"> 

function validateForm(objForm) 
{ 
 var returnStatus = 1; 

 if (objForm.dynamicSelection.selectedIndex == 0) { 
  alert("Please select a template"); 
  returnStatus = 0; 
 }; 
 if (objForm.dynamicSelection.selectedIndex == 4) 
 { 
  if (objForm.mseg.value == "") 
  { 
      alert ("Please create a new template."); 
      objForm.valueinsert.focus(); 
      returnStatus = 0; 
   } 
 } 
  
} 

 function insertOption() 
  { 
   myOption = new Option(); 
   var variable1 = document.selectionForm.mseg.value 
   var variable2 = document.selectionForm.mseg.value 
   myOption.text = variable1; 
   myOption.value = variable2; 
    if (document.selectionForm.dynamicSelection.selectedIndex>0) 
    insertIndex=document.selectionForm.dynamicSelection.selectedIndex; 
   else 
    insertIndex=document.selectionForm.dynamicSelection.options.length; 

   document.selectionForm.dynamicSelection.options[insertIndex]=myOption;    
  } 
  
  function deleteOption() 
  { 
   if (document.selectionForm.dynamicSelection.selectedIndex>0) 
    deleteIndex=document.selectionForm.dynamicSelection.selectedIndex; 
   else 
     deleteIndex=document.selectionForm.dynamicSelection.options.length-1; 

   document.selectionForm.dynamicSelection.options[deleteIndex]=null; 
  } 
  
    function Choice() 
   { 
      selectionForm.mseg.value = selectionForm.dynamicSelection.value; 
   } 
    
    
  
</script> 

<body> 
<form name="selectionForm" action="" method="POST"> 
<table width="80%" cellpadding="5" cellspacing="0"> 

<tr><td align="right">Select Template:</td> 
<td align="left"><select name="dynamicSelection" onChange="Choice();"> 
<option value="0">--Pls select the template--</option> 
<option value=""></option> 
</select> 
</td> 

<tr><td align="right"></td> 
<td align="left"><input type="hidden" name="tmpl_id"></td> 
</tr> 

<tr> 
<td align="right"> 
    BroadCast box:</td><td align="left"> <textarea name="mseg" rows="5" cols="33" 
onKeyUp="val = this.value; 
if (val.length>160) 
{ 
  alert('Sorry, you are over the limit of 160 characters'); 
  this.value = val.substring(0,160); 
  smsInput.focus() 
} 
this.form.count.value=160-parseInt(this.value.length);"> 
</textarea></td> 

&nbsp; 
<tr> <td colspan="2" align="center"> 
<input type="text" name="count" value="160" size="3" onFocus="this.blur" readonly> 
<font size="-1">characters left</font></td> 
<td colspan="2" align="left"><input type="button" value="InsertOption" onclick="insertOption();"> 
<input type="button" value="DeleteOption" onclick="deleteOption();"></td> 
</td></tr> 

<tr> 
        <td align="right">Please specify file to upload:</td> 
   <td align="left"><input type="file" name="address" size="30" maxlength="80" /></td> 
</tr> 
<tr> 
<td colspan="2" align="center"> 
<input type="button" name="submit" value="Upload" onClick="validateForm(document.upload);"> 
<input type="reset" name=".reset" value="Reset" /> 
</td> 
</tr> 
<tr><td colspan="2">&nbsp;</td></tr> 
</table> 


<input type="hidden" name="mode" value="uploading" /> 

</p> 

<p> &nbsp;</p> 

</form>