Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

anchor call on change of input box

Status
Not open for further replies.

SonicBoomBand

Technical User
Jun 4, 2004
42
0
0
GB
I've looked over the forums and the internet, but don't seem to be able to make this work.

This is my current code

<input type=text name=AllocHour onchange=window.location.href='WebESP.ASP?WCI=DNCC&WCE=SetAllocation&AllocHourBar='+AllocHour.value+'&AllocPercVal='+AllocPerc.value size=10 style='text-align: center; font-family:Tahoma' value=0.00>

Two parameters are being based into this url and is calling SetAllocation in my webclass. This all works ok but what I am trying to do is force the refresh to go to an anchor in the page.

I have created an anchor in the page which sits within a table in between rows

.........</tr>
<a name=DNCCAlloc></a>
.........<tr>

After, reading through various forum responses I expected the code below to work

<input type=text name=AllocHour onchange=window.location.href='WebESP.ASP?WCI=DNCC&WCE=SetAllocation&AllocHourBar='+AllocHour.value+'&AllocPercVal='+AllocPerc.value+'#DNCCAlloc' size=10 style='text-align: center; font-family:Tahoma' value=0.00>

but it doesn't.

Does anybody have any ideas where I am going wrong?

Andrew Chamberlain
National Grid
 
Feherke

<input type=text name=AllocHour onchange=window.location.href='WebESP.ASP?WCI=DNCC&WCE=SetAllocation&AllocHourBar=16&AllocPercVal=25.25#DNCCAlloc' size=10 style='text-align: center; font-family:Tahoma' value=16>

Hope this is what you meant

Andrew Chamberlain
National Grid
 
Hi

Code:
<input type=[red]"[/red]text[red]"[/red] name=[red]"[/red]AllocHour[red]"[/red] onchange=[red]"[/red]window.location.href='WebESP.ASP?WCI=DNCC&WCE=SetAllocation&AllocHourBar=16&AllocPercVal=25.25#DNCCAlloc'[red]"[/red] size=[red]"[/red]10[red]"[/red] style='text-align: center; font-family:Tahoma' value=[red]"[/red]16[red]"[/red]>


Feherke.
 
I'm sorry I can't see why this would make it work!

Another thing is that the input tag is written as a string in the pages' process tag, so I can't input double quotes.

Andrew Chamberlain
National Grid
 
I've managed to fix it. It seems you need put the anchor arround some text i.e.

<tr><td colSpan=16><b><font face=Tahoma size=2><a name="DNCCAlloc">Use</a> the following to assist with Allocation : Enter the time and % of Allocation</FONT></B></TD></TR>

Also, I was having a bit of a noob moment. For some reason I had the anchor sitting between rows and thus outside the table, which obviously then sets the anchor to the top of the page.

So FYI
.........onchange=window.location.href='WebESP.ASP?WCI=DNCC&WCE=SetAllocation&AllocHourBar='+AllocHour.value+'&AllocPercVal='+AllocPerc.value+'#DNCCAlloc' .........
does actually work.

Thank you for your assistance and patience with me.

Andrew Chamberlain
National Grid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top