"Popup" window

G

Guest

On a Page I want a user can select (a)name(s) from a so called "popup" window
as well as selecting a date from a "popup" calendar.
I found some examples by using JavaScript. But my question is can this also
be achieved (and how) without JavaScript, and is it advisable (not using
JavaScript in case its possible)?

Thanks
Guy
 
L

Laurent Bugnion [MVP]

Hi,
On a Page I want a user can select (a)name(s) from a so called "popup" window
as well as selecting a date from a "popup" calendar.
I found some examples by using JavaScript. But my question is can this also
be achieved (and how) without JavaScript, and is it advisable (not using
JavaScript in case its possible)?

Thanks
Guy

Except when you target very thin clients (like mobile web browser, for
example), it is more or less safe to rely on JavaScript to enhace your
site's functionalities. To be 100% safe, however, you should always plan
an alternative solution.

About your specific problems: In general, we try to avoid pop-ups,
because the public dislikes them, and because they can be blocked. The
alternative is in general using an absolutely positioned DIV, which you
show/hide using JavaScript.

To have a safe site in case JavaScript is disabled, you could do
something like this:

<a href="nojs.html" onclick="displayForm();return false;">Display</a>

This way, if JavaScript is off, the browser will navigate to the page
"nojs.html", where you present the user with a standard HTML form with a
submit button. If JavaScript is on, the HREF will be ignored (thanks to
the "return false", and the function displayForm will be executed,
allowing the user to enter his data without having to wait for a postback.

HTH,
Laurent
 
G

Guest

Thanks.

I suppose the DIV option and "To have a safe site in case ..." are two
different options?

When using DIV I suppose then putting it fe near a field where one would
like selecting info?

Laurent Bugnion said:
Hi,
On a Page I want a user can select (a)name(s) from a so called "popup" window
as well as selecting a date from a "popup" calendar.
I found some examples by using JavaScript. But my question is can this also
be achieved (and how) without JavaScript, and is it advisable (not using
JavaScript in case its possible)?

Thanks
Guy

Except when you target very thin clients (like mobile web browser, for
example), it is more or less safe to rely on JavaScript to enhace your
site's functionalities. To be 100% safe, however, you should always plan
an alternative solution.

About your specific problems: In general, we try to avoid pop-ups,
because the public dislikes them, and because they can be blocked. The
alternative is in general using an absolutely positioned DIV, which you
show/hide using JavaScript.

To have a safe site in case JavaScript is disabled, you could do
something like this:

<a href="nojs.html" onclick="displayForm();return false;">Display</a>

This way, if JavaScript is off, the browser will navigate to the page
"nojs.html", where you present the user with a standard HTML form with a
submit button. If JavaScript is on, the HREF will be ignored (thanks to
the "return false", and the function displayForm will be executed,
allowing the user to enter his data without having to wait for a postback.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 
L

Laurent Bugnion [MVP]

Hi,
Thanks.

I suppose the DIV option and "To have a safe site in case ..." are two
different options?

No.The example of link I provide displays the DIV if JavaScript is
enabled. If JavaScript is disabled, it redirects to a HTML page, where
the user can enter his information anyway. So this is safe: It's
comfortable if JavaScript is enabled, less comfortable if it's disabled,
but it works in both cases.
When using DIV I suppose then putting it fe near a field where one would
like selecting info?

I am not sure exactly what you mean. The idea is to put the fields into
the DIV. The DIV is hidden. User clicks the link --> the DIV is
displayed (it's like a pop-up, but inline). User fills the fields and
submit the form.

If JavaScript is off, DIV is not displayed. User is redirected to static
HTML form. User fills the fields and submit.

Does it help?

Laurent
 
B

bruce barker

normally you both display and move the popup. if you have selects
(dropdowns) then you need to use a floating iframe, or hide them (as
they will show thru the div).

-- bruce (sqlwork.com)
 
G

Guest

thx.
its more or less clear.
but since I only want selecting a name, ... from the inline "popup", I
suppose, in case JS is not enabled in a user's browser the alternative html
page makes less sense?

Guy


Laurent Bugnion said:
Hi,
Thanks.

I suppose the DIV option and "To have a safe site in case ..." are two
different options?

No.The example of link I provide displays the DIV if JavaScript is
enabled. If JavaScript is disabled, it redirects to a HTML page, where
the user can enter his information anyway. So this is safe: It's
comfortable if JavaScript is enabled, less comfortable if it's disabled,
but it works in both cases.
When using DIV I suppose then putting it fe near a field where one would
like selecting info?

I am not sure exactly what you mean. The idea is to put the fields into
the DIV. The DIV is hidden. User clicks the link --> the DIV is
displayed (it's like a pop-up, but inline). User fills the fields and
submit the form.

If JavaScript is off, DIV is not displayed. User is redirected to static
HTML form. User fills the fields and submit.

Does it help?

Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 
O

Ornette

You can also find help with the Ajax SDK if you want to use JavaScript stuff
without coding it and with the possibility to use it as server controls :
http://ajax.asp.net/ajaxtoolkit/

Ornette.

Guy said:
thx.
its more or less clear.
but since I only want selecting a name, ... from the inline "popup", I
suppose, in case JS is not enabled in a user's browser the alternative
html
page makes less sense?

Guy


Laurent Bugnion said:
Hi,
Thanks.

I suppose the DIV option and "To have a safe site in case ..." are two
different options?

No.The example of link I provide displays the DIV if JavaScript is
enabled. If JavaScript is disabled, it redirects to a HTML page, where
the user can enter his information anyway. So this is safe: It's
comfortable if JavaScript is enabled, less comfortable if it's disabled,
but it works in both cases.
When using DIV I suppose then putting it fe near a field where one
would
like selecting info?

I am not sure exactly what you mean. The idea is to put the fields into
the DIV. The DIV is hidden. User clicks the link --> the DIV is
displayed (it's like a pop-up, but inline). User fills the fields and
submit the form.

If JavaScript is off, DIV is not displayed. User is redirected to static
HTML form. User fills the fields and submit.

Does it help?

Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 

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

Top