Page 2 of 2
Posted: Mon Nov 26, 2007 10:02 am
by FireElement
Alright I have desided that I am going to try remove all javascript from my site, not at the minute but in future.
Is there away to either create a select box using css and making it submit on click with out using javascript. I found a form a while back that made a drop down menu in css.
I just wondered if the same tecnique could be used with floating divs as a select box and then on click submit....
I just wondered if people thought this was possible... and good practice.
http://www.xs4all.nl/~peterned/hovercraft.html
Thats the link on making drop down menus using only css... I thought maybe I could use this to make a css select box from scratch.... much more user friendly and no javascript insight. Althought there is still the refresh proplem and users generally dont like the browser moved on the page so if they click it and it submits. Say if I made all the links with in this css. Type submit.
It just the resfresh that annoys me is there no way to not do this with out refresh. wait a second... hmm if i pulled everthing in to an array then used the array this would make the page start up slow thought...
Edit:
Darn would still need the refresh to work out what they used as php is server side... grrr.... Although... I could try not trying to make it like a select box and try making it something else that worked the same... daarn it keep thinking of using client side tecniques rather then server side. darn you javascript darn you! Its like holding candy flose in front of baby and going but you cant have that its bad for your teeth!
Is there a way to possible make a css that stores the data selection in the form without using javascript...
Posted: Mon Nov 26, 2007 10:22 am
by feyd
There are CSS techniques to create drop downs that do not use Javascript at all. They do not submit anything however, but simply go to a URL.
Posted: Mon Nov 26, 2007 10:33 am
by FireElement
Yeah I know its possible to make a css that has type submit and is css styled to look like a link... so in effect it would submit to the form... the only problem with this is... it refreshes the page then posts the data back to the same form.
as your nested links would be like this, you could style it on the link? why? Just use css style sheet, but just for example.
Code: Select all
<input type="submit" value="<?=$linkname; ?>" style="whatever">
I was wondering if there was away to do this with out refreshing the page and getting the value. I thought of making one select box with all the information in and like tabing it out.... That would work... but it would look horrible. Althought it would work... hmm maybe this is the best approtch. no that would be horrible if you wanted to make a city select box. haha dam you be scroling for like half an hour to get to uk cities... Thats definatly not the best approtch.
Posted: Mon Nov 26, 2007 10:54 am
by FireElement
using radios....
That would work. That would do it.
You could make a list of radios style them in css hide the actual radio part then what ever they clicked on. would stay in the value using drop down css with radio selects.
arhhh I think that would work. Yes that would work. Then when the form was submit you would know what was clicked but... I not sure if you can style a radio to look like a button with out using javascript.
Posted: Mon Nov 26, 2007 11:16 am
by FireElement
Then it would not relay on javascript and I could have the radio buttons there and if javascript enabled then make javascript manipule it in to button by changing the class of the id onload...
Code: Select all
document.getElementById('test').class = "newclassname"
This would only work if user had javascript on. else the standard none javascript user would get an average css drop down menu that acted like a menu style select box. The javascript user would get a completlly different much nicer looking weird drop down menu style select box... which worked on radios.
This is the only way I can think of tackling chained select boxes with out the user been completley put off... without doing a refresh... maybe its not work the work...
also your code tags dont work with javascript off hhahaha unless you write them in...
Edit:
or easier way just get a div style display = block on load and if javascript on it will switch them round so you could have standard select boxes there and a weird new style drop down radio button thingy mabob that worked for none javascript users. lots of ideas now

Posted: Mon Nov 26, 2007 11:17 am
by RobertGonzalez
Why don't you just use Javascript? Code a degradation so that if JS in not enabled the code will still work. This allows you to use JS as it was meant to be used, as an enhancement.
Posted: Mon Nov 26, 2007 11:26 am
by FireElement
Everah wrote:Why don't you just use Javascript? Code a degradation so that if JS in not enabled the code will still work. This allows you to use JS as it was meant to be used, as an enhancement.
Yeah am just gonna use it as enhancements, but whats a degradation... you mean like a form that works when the user dont have javascript on? and one that does? rather then just try to make one that works for both... Well I got the idea for that... If thats what you meant?
As it is a good plan!
Although not sure you meant that?
Posted: Mon Nov 26, 2007 12:09 pm
by RobertGonzalez
No, I mean code it to work with no CSS, no Javascript, no nothing. Then enhance it with CSS. Then enhance it some more with JS.
Everything in your site should always work no matter what. If the user has disabled CSS or JS, the site should still be navigable and usable without too much interruption to the user.
Posted: Mon Nov 26, 2007 12:42 pm
by FireElement
Oh ok I understand. why would a user dissable css? is this so they can have it in the font they want?
These are all things I think I will work on in future and probable just leave the current site as it is and in future code it by degration.
Thanks for every ones input.
It was not really my decition but my friend who am doing the site for said he did not think the site would be aimed at the experenced user who would have turned javascript off or who had older browser. He also said time was an issue. Although be nice to go back to the start or go over the old code and make it 100% user freindly well he rather just get it aimed at the more commen user and see how it goes from there.
So in other words he said he dont care about the 6% of users who have either a javascript dissabled or old browser at this moment in time.
Although I learned a valuable lesson!
Always design from the bottem up. Then add css and javascript after to enhance what you already have.
Thanks a lot for feed back!

Posted: Mon Nov 26, 2007 2:23 pm
by John Cartwright
So in other words he said he dont care about the 6% of users who have either a javascript dissabled or old browser at this moment in time.
Smack your friend for me

Posted: Mon Nov 26, 2007 6:22 pm
by FireElement
I would love to accept its his site and to be honest I rather start a new one from scratch and do it perfect then take up systems anaylsis. I prefer the more japanese style of dong things! Get it right the first time and then you dont have to go over it and over it. hhaaha I think its japanese style... meh! haha
But at least I learned!