rajesh_css
10-06-2008, 09:19 AM
Hi,
I have an html
<html>
<SCRIPT LANGUAGE="JavaScript">
function updateURL(){
var sCompanyName = document.getElementById('company').value;
document.getElementById("2005").href = '../announcementList.do?year=2005&company='+sCompanyName;
document.getElementById("2006").href = '../announcementList.do?year=2006&company='+sCompanyName;
document.getElementById("2007").href = '../announcementList.do?year=2007&company='+sCompanyName;
document.getElementById("2008").href = '../announcementList.do?year=2008&company='+sCompanyName;
document.getElementById("all").href = '../announcementList.do?year=all&company='+sCompanyName;
}
<table bgcolor="ded8ba" width="100%" align="center" border="0"><tr><td class="BorderBrown">
<bean:message key="Label.Company" /></td><td>
<html:text property="company" size="50" style="LabelZ" onkeyup="showHint(this.value)" onchange="updateURL();" /><table><tr><td><div id= "txtHint" align="left" class="txtHint" ></div></td></tr></table></td><td>
<html:submit property="step" >
<bean:message key="Button.Search"/>
</html:submit> </td ></tr>
</table>
<Table style="year-button-archive" width="60%" >
<tr>
<td class="gold" >
<a title="year">By Year:</a>
<td class="gold">
<a id = "2008" title="2008" href="../announcementList.do?year=2008">2008 </a> | </td>
<td class="gold">
<a id = "2007"title="2007" href="../announcementList.do?year=2007">2007 </a> |
</td>
<td class="gold">
<a id = "2006" title="2006" href="../announcementList.do?year=2006">2006</a> |
</td>
<td class="gold">
<a id = "2005"title="2005" href="../announcementList.do?year=2005">2005 </a> |
</td >
<td class="gold">
<a id = "all" title="All" href="../announcementList.do?year=all">All </a>
</td></tr>
</Table>
</html>
my company text box is an auto suggest box
when i type any alphabet or word it suggests the text and it shows the values in the div tag.
on changing the value selected in the textbox i need to change the url.
my problem is when i type for example say
T in text box ,we get the list of companies in the dropdown of the textbox.
my url gets changed as we changed the text box value.but my url is taling only 'T'
../announcementList.do?year=all&company=T
i want to the url to be changed to
../announcementList.do?year=all&company=total solution
the one which i selected from the dropdown.
pls help me out in solving this
Thanks in advance
Raj
I have an html
<html>
<SCRIPT LANGUAGE="JavaScript">
function updateURL(){
var sCompanyName = document.getElementById('company').value;
document.getElementById("2005").href = '../announcementList.do?year=2005&company='+sCompanyName;
document.getElementById("2006").href = '../announcementList.do?year=2006&company='+sCompanyName;
document.getElementById("2007").href = '../announcementList.do?year=2007&company='+sCompanyName;
document.getElementById("2008").href = '../announcementList.do?year=2008&company='+sCompanyName;
document.getElementById("all").href = '../announcementList.do?year=all&company='+sCompanyName;
}
<table bgcolor="ded8ba" width="100%" align="center" border="0"><tr><td class="BorderBrown">
<bean:message key="Label.Company" /></td><td>
<html:text property="company" size="50" style="LabelZ" onkeyup="showHint(this.value)" onchange="updateURL();" /><table><tr><td><div id= "txtHint" align="left" class="txtHint" ></div></td></tr></table></td><td>
<html:submit property="step" >
<bean:message key="Button.Search"/>
</html:submit> </td ></tr>
</table>
<Table style="year-button-archive" width="60%" >
<tr>
<td class="gold" >
<a title="year">By Year:</a>
<td class="gold">
<a id = "2008" title="2008" href="../announcementList.do?year=2008">2008 </a> | </td>
<td class="gold">
<a id = "2007"title="2007" href="../announcementList.do?year=2007">2007 </a> |
</td>
<td class="gold">
<a id = "2006" title="2006" href="../announcementList.do?year=2006">2006</a> |
</td>
<td class="gold">
<a id = "2005"title="2005" href="../announcementList.do?year=2005">2005 </a> |
</td >
<td class="gold">
<a id = "all" title="All" href="../announcementList.do?year=all">All </a>
</td></tr>
</Table>
</html>
my company text box is an auto suggest box
when i type any alphabet or word it suggests the text and it shows the values in the div tag.
on changing the value selected in the textbox i need to change the url.
my problem is when i type for example say
T in text box ,we get the list of companies in the dropdown of the textbox.
my url gets changed as we changed the text box value.but my url is taling only 'T'
../announcementList.do?year=all&company=T
i want to the url to be changed to
../announcementList.do?year=all&company=total solution
the one which i selected from the dropdown.
pls help me out in solving this
Thanks in advance
Raj