websiteguy Posted December 26, 2007 Share Posted December 26, 2007 I am setting up a PHPFOX v1.6 site for local musicians. Currently the member's profile set-up page is made up of several dropdown fields and some textareas. My question is: Is it a major re-write to add checkbox fields or convert a dropdown to a checkbox? I would assume there would be a lot of changes to the database also? Quote Link to comment Share on other sites More sharing options...
Daleeburg Posted December 26, 2007 Share Posted December 26, 2007 If you use radio buttons you could do it without changing the database. The rewrite wouldnt be to bad if you know some html and php. ~D Quote Link to comment Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 If you have full access to the source code and backend, it should be no problem to add a check box or modify as you want. You just have to understand what you are changing. Quote Link to comment Share on other sites More sharing options...
websiteguy Posted December 26, 2007 Author Share Posted December 26, 2007 I can't use radio buttons because the client wants a maximum of 4 choices (instruments played), so it would need multiple choices as in checkboxes. The client feels dropdowns are too confusing for the average computer user (having to hold the control key), so this is his reasoning behind wanting to convert to checkboxes. I know html very well, but am still a novice with php. Quote Link to comment Share on other sites More sharing options...
websiteguy Posted December 26, 2007 Author Share Posted December 26, 2007 revraz, I do have complete access to the source code and backend. How much of a change would it be to do this. As you can see, I don't have a very good understanding of what's needed. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 26, 2007 Share Posted December 26, 2007 If you do a drop-down with size="4", and there are 4 selections, it won't need to drop-down, and there shouldn't be any confusion. The user just CTRL clicks for multiple selections. PhREEEk Quote Link to comment Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 Without seeing the source code, hard to say. But if it's already set as a drop down list with options and you want to replace those with checkboxes, it's really not hard at all. Quote Link to comment Share on other sites More sharing options...
websiteguy Posted December 26, 2007 Author Share Posted December 26, 2007 can it be as simple as changing the name of the field in the script? I've done considerable serching on this and haven't found anything specific telling me how. I would show you the code, but it's pretty involved as I'm sure you can guess. Quote Link to comment Share on other sites More sharing options...
Daleeburg Posted December 26, 2007 Share Posted December 26, 2007 If you are using php and dont want to change the tables of the database while using check boxes, then after the forum is submitted you could have it smash the data together with commas. You would still be able to search the data, but it would take a little more work. So if the user selects tuba, banjo, and harmonica, they would have to be in in an array, so that when it is submitted if position 1 has a value of 1 then "tuba," is inserted in the string then if position 3 has a value of 1 then "banjo," is inserted and so on so that the string ends up looking like "tuba,banjo,harmonica," and if you do the coding right you can get rid of the final comma, but it doesnt hurt for it to be there. ~D Quote Link to comment Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 No, OPTION lists are not the same as CHECKBOXES, you have to replace the code. You'll have 4 names instead of one as well. Quote Link to comment Share on other sites More sharing options...
tinker Posted December 26, 2007 Share Posted December 26, 2007 When you said: dropdowns are too confusing for the average computer user (having to hold the control key) did you mean that you can select multiple options from the select box? If so then it should be simple to rewrite, otherwise refer to 'Reply #8' by Daleeburg, considering what Revraz say's in 'Reply #9' Quote Link to comment Share on other sites More sharing options...
websiteguy Posted December 26, 2007 Author Share Posted December 26, 2007 Thanks for the replies! As you can probably guess, the coding is over my head and sounds more extensive than I had hoped. I might try to convince him that a set of simple instructions for the user on how to use control click would be much simpler. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 Using Phreeek's method may be worth exploring as well, it would be a 10 second change. Quote Link to comment Share on other sites More sharing options...
websiteguy Posted December 26, 2007 Author Share Posted December 26, 2007 If I understand Phreek's suggestion, he is saying to limit the choice to only 4? There would be many instruments to choose from, but only 4 maximum allowed to choose. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 No, we were under the impression you only wanted 4 options, so he was saying show all 4 options in the option list so they can get a feel that they can select more than one. So you want to list a bunch of options but only let them pick 4 of say 20? If so, that's a bit tougher to do if you want it dynamic, as in, if they pick more than 4 without hitting submit, it would say only pick 4. You can have instructions to say only pick 4 using just PHP, but you won't be able to check if more than 4 was picked until you submitted it, then you would reply back with an error saying to only pick 4. Quote Link to comment Share on other sites More sharing options...
websiteguy Posted December 26, 2007 Author Share Posted December 26, 2007 Sorry for the misunderstanding. Multiple choices would be in the list. But the admin only wants 4 maximum choices allowed to be made. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 If you want it dynamic, then you would need to use Java. If you want it to check after you hit submit, then you would have to add some error checking and if > 4 then error out and tell the user to only pick 4, and re-display the page. Quote Link to comment Share on other sites More sharing options...
websiteguy Posted December 26, 2007 Author Share Posted December 26, 2007 I did understand that there were problems involved with checkboxes when some are not checked from the reading I've done. I think a simple set of instructions to the user for control click on a dropdown field will still be much simpler. I really appreciate all the help so far though. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 It would be, but if there is a "requirement" to only allow 4, you need to do some sort of check on how many options they picked. I did understand that there were problems involved with checkboxes when some are not checked from the reading I've done. I think a simple set of instructions to the user for control click on a dropdown field will still be much simpler. I really appreciate all the help so far though. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 27, 2007 Share Posted December 27, 2007 If there are 10 choices, but only 4 allowed, you would definitely need a Javascript function to call an alert if a 5th selection was attempted. In pure PHP, you would have to process the script each time, and re-present the script if there were > 4 selections; not nearly the most elegant of solutions. This really isn't a problem unless the code is over your head. In that situation, you would do your client a big favor by outsourcing that tiny part of the form. You might also present this problem to the Javascript board where you might find someone to get this working for you for cheap or even free. PhREEEk Quote Link to comment 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.