By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

getting a path of the file in Javascript

P: 1
Hi,

I have a combo box with some values and 3 links. I am taking a combination of selected value of combo box and the link selected and redirecting to a certain page. I am using a querstring to pass the values.
It works fine as I am passing like this.

[HTML]<a href="javascript:testtest(pname);">link1</a>;
<a href="javascript:testtest(pname);">link2</a>;
<a href="javascript:testtest(pname);">link3</a>;
[/HTML]
If i am in link 2 page then if i select a value in combo box and click link1 it redirects to the proper page but my problem is if I have a submit button then how do i get the path of the file. I am not able to get the file name it says undefined.

Can some onel please help on this.
Oct 11 '07 #1
Share this Question
Share on Google+
1 Reply


dmjpro
100+
P: 2,476
Hi,

I have a combo box with some values and 3 links. I am taking a combination of selected value of combo box and the link selected and redirecting to a certain page. I am using a querstring to pass the values.
It works fine as I am passing like this.
<a href="javascript:testtest(pname);">link1</a>;
<a href="javascript:testtest(pname);">link2</a>;
<a href="javascript:testtest(pname);">link3</a>;

If i am in link 2 page then if i select a value in combo box and click link1 it redirects to the proper page but my problem is if I have a submit button then how do i get the path of the file. I am not able to get the file name it says undefined.

Can some onel please help on this.
Are you talking about the URL?
If it is ....
Then try ............

Expand|Select|Wrap|Line Numbers
  1. alert(window.location.href);
  2.  
Debasis Jana
Oct 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.