views:

364

answers:

7

Hi all, simple question really (can hazard a guess but just need to make sure),

Just need a Yes/No answer as can't seem to claify anywhere.

Reason? Web pages for phones, where javascript support is "sketchy" among all mobile browsers, so doing away with anything javascript altogether and was wondering if there are any alternatives.

(Also before someone tells me off, I am of course implementing server-side validation by default, better if possible to validate stuff right away on the client as phone text entry isn't particulaly fun to go through multiple times. Also webpage is asp.net 2.0 & c# should that affect anything)

+16  A: 

No, there is not.

I mean, obviously, the more involved answer is "Yes, of course, there are other types of client-side scripting systems (Flash/Silverlight/ActiveX/etc) that can do it", but in the context of your question (phones) then the answer is No.

I do suggest, however, that you may be surprised at what phones run JavaScript. Keep it basic, and keep it such that it fails gracefully (i.e. no harm comes to the functionality of the app with JS disabled) and you'll probably be surprised at the compatibility.

Noon Silk
I agree with silky. Also IMHO client side validation can not be trusted anyways and is only useful for performance and preprocessing reasons. The input needs to be validated properly at Server Side anyways, so if it fails on the client, it will still be validated at the server side.Well it obviously depends on your application and market.
Valentin
Actually client-side scripting can enhance the usability of the application and is not only useful for performance and preprocessing.
Waleed Al-Balooshi
@Valentin, fully agree. Client side validation is great for performance, but I wouldn't trust my data integratity to somethat that can be switched off so easily. But then again, validation at both boundaries works really well.
Furis
+3  A: 

Yes — but only in an even more limited range of browsers than those which support (and have enabled) JS.

e.g. You could use client side VBScript.

David Dorward
How is it possible?
John Saunders
Using VBScript? The same way it's possible using Javascript, but only in IE.
Olly Hodgson
+1  A: 

Not really. HTML itself only allows to limit the maximum length of a text box, which is some sort of "validation" (by restriction).

But then again - very many mobile browsers DO run JavaScript, even "Opera Mini" does support basic (or not that basic?) things of JS. Mobile Opera has full JS support, IE - too.

There is a nice list of who-can-do-it on QuirksMode.org (here: http://www.quirksmode.org/m/table.html)

naivists
+2  A: 

HTML itself allows for a very little bit of validation (the maxlength of the input forms, which is not much, as a validation).

Which means you need "more", to do real/useful validation on the client side... , if you want something that works in almost every browser, that's accessible, that doesn't annoy the user, ...


As a sidenote : don't ever forget server-side validation !
(Yes, you said it in your question -- but it's never said too many times ^^ )

Pascal MARTIN
+1  A: 

One thing I'd suggest looking at is the Mobile Device Browser File - you state that you're using ASP.NET 2.0, so provided that your server's up to date (i.e. it has .NET Framework 2.0 SP2 installed), you should be able to use it.

This will help your site determine which browser is viewing your site, what it supports in terms of controls, etc, and help you respond appropriately to the requests.

I.e. if you know in advance that the browser doesn't support JavaScript, you can remove the client side validation altogether and not send all the extra markup to the browser, making their experience of the site even cleaner.

Zhaph - Ben Duguid
A: 

Basically, no.

If your market includes browsers that support the new HTML5 input types, there's some very basic things you can do there: http://diveintohtml5.org/forms.html

Beyond that though, Javascript is really the only real client-side option.

(It could also be done in VBScript, but only in Internet Explorer)

Olly Hodgson
+1  A: 

No , there is nothing except for javascript for client side for client side validation for the time being.
But it seems that HTML5 has some interesting tags thet will help. http://dev.w3.org/html5/spec/forms.html

Shivam