954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

navigation on button click

hi,
i have a form with 3 radio buttons and one submit button.on clicking submit i want to navigate to page corresponding to the radio button selected.How can i achieve this?..

Ankita B
Light Poster
49 posts since Jan 2008
Reputation Points: 12
Solved Threads: 0
 

Hi
use document.location.href property to achieve this.
suppose u want to navigate to page example.html then u can do like this
document.location.href="example.html";

DangerDev
Posting Pro in Training
485 posts since Jan 2008
Reputation Points: 165
Solved Threads: 59
 

hey thx..i figured it out..usin window.location="url"..it wrks the same way u say..

Ankita B
Light Poster
49 posts since Jan 2008
Reputation Points: 12
Solved Threads: 0
 

Though it works, it's an incorrect way of doing things. location property of the window object is an object, not a string. The location object in turn has an href property of type string and hence location.href = "url"; is the correct, location = "url"; is not.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You