Web Standards Compliance - Autopostback / Javascript off

M

Mike Owen

Hi all,

I have an application where the user selects the colour of the clothing item
they want to buy from a dropdownlist whose AutoPostBack="True", once selected
the page is automatically posted back, and another dropdownlist is updated
showing the sizes available for the colour selected.

However I want the page to conform to the accessibility guidelines (WCAG
guideline 6) that specify that the page must continue to work with JavaScript
turned off, but of course when I do this the page does not get automatically
posted back and hence the size dropdownlist updated when a new colour is
selected.

Does anyone know a quick / easy way around this problem as I don't really
want to redesign the page.


Thanks, Mike.
 
S

Steven Cheng[MSFT]

Hi Mike,

Thank you for posting.

Regarding on the ASP.NET page's control postback, it could only be
triggered by client user's interactive operation or client-side scripts.
There is no other web standards which can make web page explicitly postback
in action to a certain html element's change. Actually, as for the
DropDownList, it is using the html <select> element's client-side
"onchange" event to trigger the page's postback(through script). For the
currently webstandard supports in ASP.NET, it is limited to UI accessiblity
features:

http://msdn.microsoft.com/asp.net/reference/infrastructure/default.aspx?pull
=/library/en-us/dnaspp/html/aspnetusstan.asp

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
M

Mike Owen

Thanks for that Steven.

I guess the only way of doing it without changing the page too much would be
to:

1/ Detect from the server whether Javascript is enabled in the clients
Browser.

2/ If Javascript is not enabled - Add an appropriate button telling the
user to click the button to (submit the form) show the sizes for the colour
selected.

Is there an easy cross Browser way of detecting whether Javascript is
enabled in the clients Browser from the server?


Thanks, Mike.
 
S

Steven Cheng[MSFT]

Thanks for the response Mike,

As for client-side javascript support detection, you can use the following
property of the ASP.NET HttpRequest class:

#HttpRequest.Browser Property
http://msdn2.microsoft.com/en-us/library/system.web.httprequest.browser.aspx

It contains some property indicate the client-browser's capability.
However, this info only indicate whether the client browser support this
feature, client user can still block or disable the script function
manually(even the browser support it). In such cases, you can use a certain
page to run a test script to detect whether the client has blocked script
functionality.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
M

Mike Owen

Thanks again Steven.

Can you guide me as to what sort of 'test script' you are talking about.
Presumably there has to be 'test script' code on both the client and server?

Cheers, Mike.
 
S

Steven Cheng[MSFT]

Thanks for your followup Mike,

The "test script" I mentioned of course means client-side
script(javascript, jscript ...). For example, you can put an html <input
type="hidden" ..../> on the page. Then, your test script will try changing
its value through the below like code:

document.getElementById("hiddenfieldid").value = "xxxx";
document.forms[0].submit();

Then, at server-side, we can check the hidden field's value to see whether
it is the changed value(by client-script). If its value is unchanged, that
means the client-script is not executed correctly due to some certain
cause(maybe script is blocked...).

Hope this help clarify some.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top