Forums

Profile page plugin, check box and boolean database field

taung 15 Feb, 2011
Hello,

I have a question relating to the Profile API, checkbox and boolean database field.

I have a form that has a check box for user consent. If a user check it, the value is set to 1 so that in the database I can use Boolean data type for the consent field.

When I enable Profile API on the form, obviously profile API cannot match back the 1 value for the checkbox to check the box.

How can I resolve this issue? I am thinking I can use Java script to translate the 1 values and check the appropriate box.

Questions I have are
1. Which code block run first when a form is loaded: the Javascript block or Profile API?
2. Even if the checkbox is not checked properly, does profile api correctly load the value from database to to corresponding form input field value?
3. If I read the field value from Javascript and if it is one, check the corresponding checkbox, when the user submit the data, will the correct data write back to the database (of course I have Editable on in profile api).

Thanks.
Max_admin 15 Feb, 2011
Hi taung,

is it possible to install V4 on your website (requires joomla 1.5.19 or later with mootools upgrade plugin enabled) and test this ? if so then let me know if it works fine or not, also it will be easier to answer any sequence questions you may have🙂

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 15 Feb, 2011
Hi tuang,

In ChronoForms v3.2 the Profile plug-in should recognise a checkbox value assuming that the column name matches the input name.

The Form JavaScript is loaded directly into the page and is not evalauted at PHP so it isn't possible to alter this code depending on a variable. However you can set it to execute on domReady so that you can insert a JavaScript variable in the page load for it to read and use.

The form will write back whatever values are include so provided that your checkbox has the same name and a value of 1 (or a value that converts to to 1) it should be saved OK.

Bob
taung 17 Feb, 2011
Max
I can't install version 4 because I don't think all APIs, especially PayPal API, is not ready for version 4 yet. Or did I miss the memo? Are all APIs currently available for V3.x.

Bob,
I was planning to do it via domReady, so I will try it out.

Thanks to both of you for the replies.
GreyHead 17 Feb, 2011
Hi tuang,

The authorize.net plugin is there in the latest release but not the PayPal or ReDirect plugins (I guess we call them Actions now).

Bob
Cazzie01 05 Aug, 2011
0 down vote favorite
share [fb] share [tw] share [in]
Please login or register to vote for this post.
(click on this box to dismiss)


I have installed levitra online the more fields plugin which gives me access to a custom field checkbox. When setting the field up through the plugin the caption says: Creates single checkbox, which key is either on/off. As you can see by the query I am looking for all the events whose event-archive = on.

Is there a better way to do this? This doesn't return any posts anyways. Is there a better way to build a boolean field?

$archive_query = new WP_Query(
array(
'post_type' => 'event', // only query events
'meta_key' => 'event-archive', // load up the event_date meta
'order' => 'desc', // ascending, so earlier events first
'posts_per_page' => '5',
'meta_query' => array(
array( // restrict posts based on meta values
'key' => 'event-archive', // which meta to query
'value' => 'on', // value for comparison
'compare' => '=', // method of comparison
'type' => 'CHAR' // datatype, we don't want to compare the string values
) // meta_query is an array of query ites
) // end meta_query array
) // end array
); // close WP_Query constructor call

custom-field
GreyHead 05 Aug, 2011
Hi Cazzie01,

This is a forum for the ChronoForms form extension for Joomla!. It looks as though you are using some other forms extension for WordPress. Sorry that we can't help you.

Bob
This topic is locked and no more replies can be posted.