Neeraj
Neeraj

Reputation: 1173

Javascript Disabled

i have a select dropdown list which has 4-5 fields. As soon as a user selects a value in the dropdown i have to assign a value to a hidden parameter on the page. (Using javascript function Onchange). The same hidden parameter is passed on to a hyperlink url whenever a user clicks on to it on a same page.

This works fine when javascript is enabled, but what to do when javascript is disabled ? i know there is noscript tag but how can i achieve above functionality ? can you give me some example code ?

Many Thanks,

Upvotes: 0

Views: 254

Answers (3)

Neeraj
Neeraj

Reputation: 1173

The solution to my problem is that i created a url and then overwrite it using noscript tag. on click i was calling a javascript function which was again overwriting the same .

thus when javascript was enabled, onclick function was sending it to popup and when javascript was disabled the noscript tag was overwriting it and redirecting to a another page.

Upvotes: 1

Nivas
Nivas

Reputation: 18354

When javascript is disabled, then, javascript is disabled. Javascript is not there. So any solutions relying on javascript being there will not work.

If you want to support javascript disabled users also, then you must design the page sconsidering that.

In your case, you might want to use the value of the <option> in the <select> that is submitted when the form is submitted (no matter whether javascript is enabled or not)

Upvotes: 1

Paul
Paul

Reputation: 2769

There is nothing that will assign it to a hidden field if you have javascript disabled.

If javascript is disabled you will have to be able to handle the form posting to the server and figuring out on the serverside from the selected item in the form.

Upvotes: 4

Related Questions