2 Replies - 1905 Views - Last Post: 06 March 2012 - 09:44 AM Rate Topic: -----

#1 De.camm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 05-March 12

Search button function for catch the data.

Posted 05 March 2012 - 11:26 PM

Hi, i am new in coldfusion language, here i need to know the coding path for button search to get the data from database,
i mean here is i want to create a search path to extract all the related data in database, let say i have Name path, then when i type G alphabetical, then all the starting related "G" name will appear.

Thnaks.
Is This A Good Question/Topic? 0
  • +

Replies To: Search button function for catch the data.

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1937
  • View blog
  • Posts: 3,477
  • Joined: 13-January 08

Re: Search button function for catch the data.

Posted 06 March 2012 - 06:52 AM

Welcome to DIC De.camm. Since you're new you're probably unfamiliar with how things work here. Here is a place where you ask specific coding related questions, explain (in detail) the problem you're having, post some of the code you've written that's not behaving and people here try and lend you a hand or some insight into what's happening.

Generally you don't get anything asking for someone to code your project for you...whether you are new in language or not. We're here to help. Not do your work for you.

If you have code that's not performing please post back with a detailed explanation of what it's doing and what you want it to do and we'll see if we can help.
Was This Post Helpful? 0
  • +
  • -

#3 De.camm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 05-March 12

Re: Search button function for catch the data.

Posted 06 March 2012 - 09:44 AM

View PostCraig328, on 06 March 2012 - 06:52 AM, said:

Welcome to DIC De.camm. Since you're new you're probably unfamiliar with how things work here. Here is a place where you ask specific coding related questions, explain (in detail) the problem you're having, post some of the code you've written that's not behaving and people here try and lend you a hand or some insight into what's happening.

Generally you don't get anything asking for someone to code your project for you...whether you are new in language or not. We're here to help. Not do your work for you.

If you have code that's not performing please post back with a detailed explanation of what it's doing and what you want it to do and we'll see if we can help.


Thanks Craig for reply in this post, actually I tried to make my button search to detect any first alphabetical that enter by user, and the input will select the possible data in database to display in the same page inside table list. here is my coding that still not working.
<script language="javascript">
	function refreshStudentList(){
		
		ColdFusion.navigate('index.cfm?section=search&action=StudentList'
								+'&SName='+document.getElementById('SName').value
								+'&Mykad='+document.getElementById('Mykad').value
								+'&search=search','StudentList');
	}
</script>
<cfquery datasource="RegStudent" name="DisplaySearchingData" >
select * from student
ORDER BY firstname, lastname
</cfquery> 
<cfoutput><h3> SEARCH STUDENT DETAILS </h3></cfoutput>
<br/>
<table width="30%" align="center">
<form id="form1" name="form1" method="post" action="">
<tr>
<td>Student Name :</td>
<td width="20%"><input type="text" value="" size="35" name="SName" id="SName"  style="text-transform:uppercase;"/></td>
</tr>
<tr>
<td>MyKad No. :</td>
<td width="20%"><input type="text" name="Mykad" size="35" value="" /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
  <input type="submit" name="Search Student" value="Search" onclick="DisplaySearchingData"/>
  &nbsp;<input type="Reset" name="ResetForm" value=" Reset" />
</div></td>
</tr>
</form>
</table>
<table width="675" border="1" align="center">
  <tr>
    <td width="50" align="center" bgcolor="#999999"><strong>List</strong></td>
    <td width="137" align="center" bgcolor="#999999"><strong>Student Name</strong></td>
    <td width="162" align="center" bgcolor="#999999"><strong>Mykad No.</strong></td>
    <td width="153" align="center" bgcolor="#999999"><strong>Address</strong></td>
  </tr>
 <cfoutput query="DisplaySearchingData" >
  <tr>
    <td>#DisplaySearchingData.currentrow#</td>
    <td>#firstname# #lastname#</td>
    <td>#mykad#</td>
    <td>#address#</td>
    </tr>
  </cfoutput>
</table>


Now the button "search" is not function, its same function as the reset button.

This post has been edited by Craig328: 06 March 2012 - 09:46 AM
Reason for edit:: Please use CODE tags when posting code samples

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1