Marcandria
Marcandria

Reputation: 415

Using dependent fields without Javascript

I was wondering if it was possible to make a "dependent" field in a web form without using Javascript ?

My code consists in this :

<select>
    <option value="1">Value 1</option>
    <option value="2">Value 2</option>
    <option value="3">Value 3</option>
</select>

And when I select a value, another select is populated, via JQuery's $.post(), with data fetched from my database.

But how can I keep this if the browser has JS disabled, or do not support Javascript ?

Thanks in advance

Upvotes: 2

Views: 656

Answers (2)

XQDev
XQDev

Reputation: 366

There is no way to trigger an event like this. You need to reload the document and pass your data through some server code. (PHP or something else)

Upvotes: 1

kamituel
kamituel

Reputation: 35960

Looking at the HTML5's specification of option and select elements, I would say it's impossible.

Upvotes: 2

Related Questions