/    Sign up×
Community /Pin to ProfileBookmark

Need php code to display checkbox output

HI,

I have installed Chronoform v5 component to create a form for my Joomla site. For example My Checkbox group e.g, has following values:
Review: Good
Bad
Average

Suppose if any user Checks two items i.e, Bad and Average, the format in which it should save in database should be like: label:mesaage as Yes(if checked) or -(if not checked)

Review: Good: –
Bad: Yes
Average: Yes

In short it should display all checkbox values but should display ‘Yes’ in front of the value selected by user. Is it possible?? Any suggestions?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@jedaisoulAug 24.2015 — It sounds like you want someone to write the whole back-end for you? We don't usually do that, at least, not for free!!! If you have some code you've written and have a problem, we can often help.
Copy linkTweet thisAlerts:
@NogDogAug 24.2015 — One thing you'll need to remember is that checkboxes only get sent to the server if they care checked, so when setting the values to be saved in the DB, you'll need to use something like isset() to determine if the box was checked, e.g.:
[code=php]
if(isset($_POST['field_name'])) {
// field_name checkbox was checked, so handle accordingly
}
else {
// it was not checked, so store whatever you want in that case
}
[/code]
Copy linkTweet thisAlerts:
@poojah12authorAug 24.2015 — isset($_POST['Services']) ? 'Yes' : 'No'; is the code i am using. The issue is actually not with the code. I am confused as to where to place this piece of code into chronoforms which is a component in Joomla for forms. I want to place this code in order to get the desired result format.
Copy linkTweet thisAlerts:
@NogDogAug 24.2015 — isset($_POST['Services']) ? 'Yes' : 'No'; is the code i am using. The issue is actually not with the code. I am confused as to where to place this piece of code into chronoforms which is a component in Joomla for forms. I want to place this code in order to get the desired result format.[/QUOTE]

That I cannot help out with, then, since I've never used Joomla nor Chronoforms. ? If you've not already done so, you might want to check for any user forums on their respective web sites, as that will probably increase your chances of finding someone with the exact experience/knowledge you need.
Copy linkTweet thisAlerts:
@poojah12authorAug 24.2015 — Thnk you anwez ?
×

Success!

Help @poojah12 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...