Code for navigation

T

thulasibhaskar

In a web page with left navigation bar with tree view, i have 3 parent
nodes and for each parent node there are two children nodes,once after
loging to that web page , i have opened one children node and started
entering values in that form but in the middle if i want to open
another children tag i should get a confirmation message like"Do u
want to navigate away from this page?" , if i say ok it has to go the
requested Page or if have opted cancel button i should continue in the
same page.
So, Please help me how to write a function in javascript which has to
be called onClick.
 
R

RedGrittyBrick

In a web page with left navigation bar with tree view, i have 3 parent
nodes and for each parent node there are two children nodes,once after
loging to that web page , i have opened one children node and started
entering values in that form but in the middle if i want to open
another children tag i should get a confirmation message like"Do u
want to navigate away from this page?" , if i say ok it has to go the
requested Page or if have opted cancel button i should continue in the
same page.
So, Please help me how to write a function in javascript which has to
be called onClick.

Despite the similarities in name, Java and Javascript are two very
different programming languages. People who know Java very well may not
know Javascript.

I suggest you ask your question in comp.lang.javascript where I expect
you'll get a better set of answers.

In your position, I'd buy a book on Javascript.
 
A

Arved Sandstrom

Sabine said:
That said, the functionality the OP wants is not regarded as a good
practise - keeping (or trying to) people from navigating webpages is a
no-no.

In general I agree, but it sure looks to me like the OP merely wants to
throw up a confirmation screen, and will allow the page switch if the
user confirms.

I maintain several web applications where we do exactly this if the user
elects to navigate out of certain situations. They stand to lose a lot
of work if a mistaken click on a navigation tab suddenly puts them
inside a completely different functional area of the application. It
doesn't hurt to throw up a confirmation prompt.

AHS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top