ricerocket Posted March 2, 2008 Share Posted March 2, 2008 Hi, I was wandering if it was possible to make a form radio button into an image instead of the little round thing that gets "checked" when you click on it. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/93997-need-help-with-form-radio-buttons/ Share on other sites More sharing options...
AndyB Posted March 2, 2008 Share Posted March 2, 2008 That sounds like a lot of work for no functional gain and lower accessibility. Quote Link to comment https://forums.phpfreaks.com/topic/93997-need-help-with-form-radio-buttons/#findComment-481576 Share on other sites More sharing options...
ricerocket Posted March 2, 2008 Author Share Posted March 2, 2008 well yea kinda I guess, I would use an image submit button but I need it to display different content if a certain radio is clicked. Do you have any other suggestions on how I should do this? Quote Link to comment https://forums.phpfreaks.com/topic/93997-need-help-with-form-radio-buttons/#findComment-481580 Share on other sites More sharing options...
haku Posted March 2, 2008 Share Posted March 2, 2008 The actual circle itself? You could *maybe* do it with javascript. You would have to position an image of your unchecked replacement radio button directly overtop of the radio button, then set that image with an onclick function so that when you clicked it, it switches the image with that of your checked replacement radio button, and also have the javascript check the actual radio button underneath. It wouldn't work with users who have javascript turned off though. Quote Link to comment https://forums.phpfreaks.com/topic/93997-need-help-with-form-radio-buttons/#findComment-481706 Share on other sites More sharing options...
ricerocket Posted March 2, 2008 Author Share Posted March 2, 2008 Yea I guess I could do that... also just to ask is there any other way to have it where when a button or image button is clicked is shows a form but if another button say next to the first is click the form disappears and a new form shows up. for example if there is a page on my site that requires the user to be logged in, I would have a session/cookie checker and if now cookie is found it displays two buttons, one says "Existing users login" and one next to it says "New users register" And when the login button is clicked a form apears for them to login with username/password. But when they click on the register button the login form disappears and a registration form shows. Is there anyway of doing this? And I'm new to this kind of stuff so please don't make any comments about how easy this can be. Quote Link to comment https://forums.phpfreaks.com/topic/93997-need-help-with-form-radio-buttons/#findComment-481722 Share on other sites More sharing options...
haku Posted March 2, 2008 Share Posted March 2, 2008 Its not the easiest thing, but nor is it the hardest thing. But again, its javascript. There are two ways it can be done - a new window can be opened with the form information on it, or divs can be created with the form information inside, and set to invisible, then when the buttons are pressed, they are set to be visible. But both of these also require the user to have javascript turned on. And if you don't know javascript, you may be out of luck, although you could potentially google around for some tutorials. Quote Link to comment https://forums.phpfreaks.com/topic/93997-need-help-with-form-radio-buttons/#findComment-481983 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.