Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Change hyperlink's URL from client side

Reply
Thread Tools

Change hyperlink's URL from client side

 
 
Hardy Wang
Guest
Posts: n/a
 
      07-19-2004
Hi,
I have a web form with a Hyperlink control, which renders client code
like:
<form id="form1" name="form1">
<a href="a.aspx?p=ppppp" id="mylink" target="_blank" >
</form>

What a need is when this link is clicked, I need to trigger a client
side JavaScript function to append some other parameter to exsting query
string, and then new window opens. I have to run this from client.

<script language="javascript">
function MyFunc() {
document.form1.mylink.href += "&b=NePrameter";
}
</script>

This method doesn't work.

Anybody has some idea?


Thanks

Hardy


 
Reply With Quote
 
 
 
 
chenhuawei
Guest
Posts: n/a
 
      07-20-2004
Did you forgot the onclick event?
<a href="a.aspx?p=ppppp" id="mylink" target="_blank" onclick="MyFunc()">
and then you can debug from the browser.maybe can help you
"Hardy Wang" <(E-Mail Removed)> дʼ
news:(E-Mail Removed)...
> Hi,
> I have a web form with a Hyperlink control, which renders client code
> like:
> <form id="form1" name="form1">
> <a href="a.aspx?p=ppppp" id="mylink" target="_blank" >
> </form>
>
> What a need is when this link is clicked, I need to trigger a client
> side JavaScript function to append some other parameter to exsting query
> string, and then new window opens. I have to run this from client.
>
> <script language="javascript">
> function MyFunc() {
> document.form1.mylink.href += "&b=NePrameter";
> }
> </script>
>
> This method doesn't work.
>
> Anybody has some idea?
>
>
> Thanks
>
> Hardy
>
>



 
Reply With Quote
 
 
 
 
Hardy Wang
Guest
Posts: n/a
 
      07-20-2004
Yes, I know OnClick, but it does not work.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
Help: How do I change the type of text list, from up-down to side-by-side... Eric Computer Support 5 07-28-2005 10:44 PM
right button click on any URL posts that url to a server-side form castnblast Javascript 0 12-01-2004 10:12 PM
Adding custom client-side onClick handler with client-side validator controls Zoe Hart ASP .Net Web Controls 1 01-08-2004 10:45 PM



Advertisments