Giter Site home page Giter Site logo

php-form-builder-class's People

Contributors

ajporterfield avatar

Watchers

 avatar

php-form-builder-class's Issues

Replace table structure with CSS friendly markup

It is difficult to style the current form with the generated tables,
instead this should be replaced with a cleaner table-less CSS based layout.

An example of how the class could generate the form in a more friendly way
can be read at the tutorial at:

http://articles.sitepoint.com/article/fancy-form-design-css

Original issue reported on code.google.com by [email protected] on 9 Apr 2010 at 6:38

File Upload does not work

What steps will reproduce the problem?

1.File Upload does not work

What is the expected output? What do you see instead?

I want to see the uploaded file name to be able to handle the file after
upload.
I see nothing in the $_POST variable.
The parameters for name and value are set.

(Last tried this string among others

$form->addFile("File:", "field13","$foobar=blubber", array("filename" =>
"File"));

)
I use the elements example page, and after submitting not even the value
"field13" is shown!


What version of the product are you using? On what operating system?
1.0 linux

Please provide any additional information below.

Please provide an example for the addFile function.


Original issue reported on code.google.com by [email protected] on 13 Mar 2010 at 5:39

reCAPTCHA Public/Private Keys Hard-coded

Hi,

The Public/Private keys within reCaptcha as explained on the reCAPTCHA site:

"This key pair helps to prevent an attack where somebody hosts a reCAPTCHA
on their website, collects answers from their visitors and submits the
answers to your site."

So I assume if anyone can get a hold of these keys (which they can with
this class) they will be able to do the attack explained as above.

So we need to be able to specify the public/private keys in the class.

So something like:

 line 82:
    protected $captchaPrivateKey; /* User supplied reCaptcha private key */
    protected $captchaPublicKey; /* User supplied reCAPTCHA public key */
line 2444:
                $str .= "\n\t\t" . 'Recaptcha.create("'. $this->captchaPublicKey . '",
"' . $captchaID . '", { theme: "' . $this->captchaTheme . '", callback:
Recaptcha.focus_response_field, lang: "' . $this->captchaLang . '" });';
line 2547:
        $this->captchaResp = recaptcha_check_answer( $this->captchaPrivateKey ,
$_SERVER["REMOTE_ADDR"], $tmpRefArr["recaptcha_challenge_field"],
$tmpRefArr["recaptcha_response_field"]);


(I havnt tested if this works yet, ill post again soon)

Original issue reported on code.google.com by [email protected] on 24 Feb 2010 at 2:30

big picture...

Hi, not an 'issue', just wondering where you are going with this project?

I've played with it a bit, and here's my $.02



You have built a lovely simple way to define a fairly complex form.  But in
some ways, it's TOO simple.

i'm working on a little project where there are a dozen or so complex
forms, perhaps hundreds of fields that will need to be defined.

the first thing i did was write a wrapper to replace your hand-crafted demo
forms with a data-driven model.  i create my forms dynamically from the
data schema.  when i add a data element, it includes fields that define
initial values, how it behaves on a form, and what it looks like in the
database.  (sounds complicated, but it's just a spreadsheet that I load as
a CSV).

but it's going to be more complicated than that.

so here's what i've been running into:




addElement has the five basic elements (prompt, id, type, value,
additionalParams), but immediately I find myself wanting to add more.  

for example, I would like to add a validation callback in PHP (perhaps
using create_function()).  you offer a 'required' parameter, but real life
is more complicated.

in some cases the options for a field are pulled dynamically out of the
data (eg: your editor may have a view that shows your function names).
so i would like to be able to provide a PHP function that creates the array
of options for a pull-down (or autosuggest).

it's not clear how i can specify whether to send parameters to jquery or to
HTML (or whatever).





you rely on CSS to lay out the form, but you don't allow the programmer to
suggest a structure. 

when I think of a form, it's a complex structure.  it may have multiple
tabs, multiple panels that group similar items,  pop-up sub-forms, etc.  
look at the 'preferences' tab on your browser or text editor for an example. 

consider letting the programmer add structure  'levels' to the form.  this
is like a menu with <ul> and <li>. - CSS determines whether it is
horizontal, vertical, whatever, and what each element looks like.  

with a suggested structure, CSS has something to work with - maybe
rendering the top level as tabs, or as separate pages for a mobile device.
 it also providing theme consistancy at the bottom level.  maybe make the
top level explicit in your definition language (addElement 'startPage'),
because CSS can't really handle some of the things that we might want to do
with forms.

(i'm already sending in 'style' as an additionalParam, that's great).



XHTML compliance is a nice idea.  but don't lose sight of the goal.   when
someone is using your form builder, they have have more to do than
'username/password'.  i would focus efforts on making this class the
obvious choice for someone writing projects with complex web forms.




you are going to be swamped with 'enhancement' requests.   why not make the
class extensible, letting programmers write (and contribute) widgets.

for example, i was working today on a jquery 'radio-button' with three
color-coded slices (NOW, LATER, DONE).   if i use it, then i'm going to
need to add it to the form class.

this widget taught me something else too - i learned that the programmer
really needs to drill into the implementation details.  for example, if I
want a 'submit' behavior with a datepicker, i need to use the jquery method
onSelect.  but a jquery button does not have any methods, i need to use the
html method.

maybe that's something your class can hide for the commonly-used methods,
provide common behaviors without having to study the details of jquery and
class.form.php.




i'm excited by your project, i think there is a need for it.  there's so
much to do.





Original issue reported on code.google.com by [email protected] on 12 May 2010 at 8:45

session_name invalidates session checker for class

What steps will reproduce the problem?
1. declare a session_name("MYSESSION") prior to session start

What is the expected output? What do you see instead?
Session continues on as expected and the php-form-builder-class works
without errors.  Instead the following error is displayed: 
"A session is required to generate this form's necessary javascript and
stylesheet information.  To correct, simply add session_start(); before any
output in your script."

What version of the product are you using? On what operating system?
1.04

Please provide any additional information below.
The following breaks the class when anything besides the default PHPSESSID
is declared.
session_name("MYSESSIONNAME");
session_start();


Original issue reported on code.google.com by [email protected] on 5 May 2010 at 9:43

Radio buttons checked

Radio buttons are checked by default, it would be good to be able to set
them unchecked and then have the javascript/php make sure that one of them
has been selected.

Original issue reported on code.google.com by [email protected] on 29 Jan 2010 at 6:01

$cmd not set in php_validation.php example

Hi,

It seems that the php_validation.php example doesnt work because $cmd is
never set.

To make it work I must change the top of the example to something like:

if(isset($_POST['cmd'])){
  $cmd = $_POST['cmd'];
} else if (isset($_GET['cmd'])){
  $cmd = $_GET['cmd'];
} else {
  $cmd = "";
}

I see in your example online it works, so im not sure whats going on there...

Thanks.

Original issue reported on code.google.com by [email protected] on 22 Jan 2010 at 4:10

Upgrade to jQuery 1.4.x

Sometime in the near future, the jquery components need upgraded to 1.4.x.
 They are currently using version 1.3.2.  I'm assuming all the jquery ui
fields should be ready to go; however, the plugins (qTip, ColorPicker,
daterange, rating) may not be quite ready yet.  Research needs to be done.

- Andrew

Original issue reported on code.google.com by [email protected] on 27 Apr 2010 at 5:57

output error messages in html

First off i love the simplicity of your package.

Using alert() to display error messages has many drawbacks and penalties.

- First off it is impossible to make your form uniform across browsers.
- It is not degradable for no JS users.
- It causes some confusion because the user must remove the box before they
address the problems. They might forget what the message said while they
are trying to correct the problem. This is especially true when there are
multiple errors. Having the errors on the page allows a handy reference for
the user to look back and forth to.
- Alert boxes can not be styled.
- They are not friendly to handicapped users. most screen readers will not
read them and they can not be magnified by browser settings increasing font
size.
- They are kind of 'rude', i know this is not empirical, but people expect
that when something pops up on a web page it is spam or even worse some
kind of hacking attempt to get them to click something to download a virus.

I would suggest having a blank div at the top of the form and use the JS to
write the error messages to that div after validation. This would also be
easier for server side validation to hook into.
Alternatively it would be cool to have error messages inline with each
element that triggered an error.
I would be willing to help change the code to accommodate this if someone
with more intimate knowledge can point out any pitfalls to re-writing the
jsCycleElements function.
You can reach me at mdelay at imaginepub dot com
marc

Original issue reported on code.google.com by [email protected] on 12 Apr 2010 at 10:58

quick addon for includePath troubleshooting


I move the includes directory to another location to keep the directory
structure of my project and to help me figure out why things were not
working(paths to jquery etc)  I added $this->phpincludePath to the error
message.

Specifically on like 1083 of the main class.

if(empty($this->phpIncludesPath) || !is_dir($this->phpIncludesPath))
            $str .= "\n\t" . '<script
type="text/javascript">alert("php-form-builder-class Configuration Error:
Invalid includes Directory Path\n\nUse the includesPath form attribute to
identify the location of the inclues directory included within the
php-form-builder-class folder.\n\n' .$this->includesPath .'");</script>';


This helped me see what path the class was actually seeing, vs what I
intended it to truly be.

This this small addition I was able to move the includes directory
structure to pretty much any place I wanted.

Great work on the form builder class I intend to use it from here forward.




Original issue reported on code.google.com by [email protected] on 5 May 2010 at 2:29

Session parameters sent to js.php

I know this has been discussed before, but before I start hacking away at a
potential solution I wanted to post it.

It looks like session are not getting set correctly via this code below.


this section in the code: Lines 1888 thru 1910

$_SESSION["pfbc-instances"][$this->attributes["id"]] = serialize($this);

    $session_param = "";
    $session_name = session_name();



    if($session_name != "PHPSESSID")
        $session_param = "&session_name=$session_name";

    $str .= <<<STR
        <script type="text/javascript">
            var css = document.createElement('link');
            css.rel = 'stylesheet';
            css.type = 'text/css';
            css.href =
'{$this->jsIncludesPath}/css.php?id={$this->attributes["id"]}$session_param';
            head.appendChild(css);

            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.src =
'{$this->jsIncludesPath}/js.php?id={$this->attributes["id"]}$session_param';
            head.appendChild(script);
        </script>
    </div>  

------

 So what I am seeing in this is that the myform or what every you set your
form id to in the setAttributes gets passed to the above code.  The
session_name() isn't returning PHPSESSID as it should.. Which means at this
level the class is out of scope of the $_SESSION. (ie it's not seeing it.

A quick/dirty hack could be to to append &session_name=PHPSESSID just to
get it to work. 

But this still doesn't answer the question of why the class isn't seeing
the session.

Something just doesn't look right.


Original issue reported on code.google.com by [email protected] on 13 May 2010 at 2:12

Support fieldsets/legends

It is often needed on larger sized forms, the use of field-sets to separate
groups of input.

We could do something like:

$form->openFieldset("This is the fieldset legend");
$form->addWebEditor("Web Editor - TinyMCE:", "field2");
$form->addCKEditor("Web Editor - CKEditor:", "field3");
$form->closeFieldset;
$form->openFieldset("Another Fieldset!");
$form->addPassword("Password:", "field4");
$form->addFile("File:", "field5");
$form->addDate("Date:", "field6");
$form->closeFieldset;

There is probably a neater way to do it... but it should support nesting of
fieldsets.

Original issue reported on code.google.com by [email protected] on 21 May 2010 at 7:34

Date selector should allow easier switching of year

What steps will reproduce the problem?
1. Add Date Field to Form
2. Try To change date 20 years back & forth (by example asking for date of
birth). Creator of form does not know where to set startvalue & user needs
to click too much to get from now to 1980

What is the expected output? What do you see instead?
Have a select box in the date selector to change year.

What version of the product are you using? On what operating system?
latest.

Please provide any additional information below.
I have this issue creating a registration form for a website.

Original issue reported on code.google.com by [email protected] on 1 Jun 2010 at 7:01

Easy way to extend the class with new elements

The issue by tom.berend "big picture.." , seems to be partly a request for
an easy way to extend the class, or a plug-in based system.

A user should not have to modify the class if there is not a specific type
of element already included.

I think we should only include the particularly standard element types in
the class, and then modularize the other elements.

They could be each a simple file that is loaded from the includes
directory, and then can be called through the form.

Original issue reported on code.google.com by [email protected] on 19 May 2010 at 6:31

Pre-filling Form Elements with date in the future

What steps will reproduce the problem?
1. Pre-Filling a $form->addDate with a Date in a future month
2. The Date is shown correctly
3. Click in the field to open the calendar

What is the expected output? What do you see instead?
I expect the month and day of the prefilled date
Instead the calendar is on the actual day / month

What version of the product are you using? On what operating system?
Current Version: 0.9.8
XP and Linux PHP 5



Original issue reported on code.google.com by [email protected] on 10 Feb 2010 at 3:03

inclusion in drupal

Errore: CKEDITOR is not defined
When i insert the code in a drupal page i've this error and when i submit
the form the browser(ffirefox) return me an alert with the code of the
entire page

Original issue reported on code.google.com by [email protected] on 21 Apr 2010 at 4:22

CKeditor Intergration

Hi,

I know we already have tinyMCE but I prefer CKeditor ( http://ckeditor.com/ )
and since my projects already are using CKeditor its a bit of a mess to
also have tinyMCE.

We could have both of these editors in the class... if you will allow
CKeditor to be added I can make the edits needed for it.

Thanks!

Original issue reported on code.google.com by [email protected] on 3 Mar 2010 at 2:58

Right to Left (Hibrow & Arabic) is not supported!

What steps will reproduce the problem?
1. Web editors do not provide rtl-ltr switching toolbar while it shouldn't
be very complicated.
2. Text aligns are not rtl compatible and changing the dir attr. of body
can not solve it. Labels are still left aligned. would be better to add a
dir attr. to form object.
3. Date object does not support any calendar systems other than Gregorian!  

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
Version 3, 29 June 2007, Win7 with chrome/firefox

Please provide any additional information below.
Jalali calendar is largely used in the middle east and is known to
Microsoft as "Persian Calendar" and fully supported in the .NET Framework,
but not mentioned in date picker!

Original issue reported on code.google.com by [email protected] on 11 Apr 2010 at 10:11

Support for browsers without javascript

At the moment there are many methods on the form where when javascript is
turned off you are no longer able to fill in the entire form.

Do you plan on making the class friendly to users with javascript turned off?

Some of the fields wont be too hard to do, for instance recaptcha already
can support when users dont have javascript turned on... Below are changes
for recaptcha to get it going without javascript, I need to read the
recaptcha API a bit more to let you change the template theme color and
language, but you get the idea.

2067:
                elseif($eleType == "captcha")
                {
                                        if(empty($this->ajax)){
                                            require_once($this->captchaPath
. "/recaptchalib.php");
                                            $str .=
recaptcha_get_html($this->captchaPublicKey);
                                        }

2663:
                    if(!empty($this->ajax)) {
                        if(empty($this->preventCaptchaLoad))
                            $str .= "\n\t" . '<script
type="text/javascript"
src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>';

                        $str .= "\n\t" . '<script type="text/javascript">';
                        $str .= "\n\t\t" . 'Recaptcha.create("' .
$this->captchaPublicKey . '", "' . $captchaID . '", { theme: "' .
$this->captchaTheme . '", lang: "' . $this->captchaLang . '" });';
                        $str .= "\n\t</script>\n\n";
                    }

Original issue reported on code.google.com by [email protected] on 15 Mar 2010 at 2:54

relative address unknown when creating a Joomla! component

Hi, LOVE THIS LIBRARY !!!   You guys are awesome.

I'm not a red-hot programmer, so maybe I'm doing something stupid, in which
case I apologize in advance.

Trying to create a Joomla! component.  

If i set the relative includesRelativePath" correctly (ie: /includes), then
i don't get the error message.  but the forms don't work - specifically the
TinyMCE and CKEditor don't initialize.

Here's what i had to do to get the code working.

"includesRelativePath" => JURI::base( true )
."/components/com_agenda/php-form-builder-class/includes"


Trouble is that now the 'Invalid Includes Directory' error message pops up,
even though the example scripts work perfect when I embed them in my code.  

My guess is that the FILE_EXISTS() and IS_DIR() functions are relative to
the start of Joomla!.

I'm running version 1.0.2 under Ubuntu.

Original issue reported on code.google.com by [email protected] on 12 Apr 2010 at 2:13

setReferenceValues on (multiple) Selectbox not working

Hello
first of all thank you (SO) much for this grate class, it's a priceless
peace of art.


i have the following code:

========
$form = new form();
$form->setAttributes(array(
    "tableAttributes" => array("width" => "500"
));

if ($_POST['test']) {
    echo "<pre>";
    var_export($_POST);
    echo "</pre>";
        $form->setReferenceValues($_POST);
}

$form->addHidden("test", "Yes");
$form->addSelectbox("Extra Category:", "ExtraCategory[]", "",
$CategorysArray, array("multiple" => 1));

$form->addButton();
echo $form->render();
========

when i click submit, and the page load again the setReferenceValues fail to
set the values for the select box with multiple selections, it only select
the last option selected.

Original issue reported on code.google.com by [email protected] on 15 Feb 2010 at 8:20

bind() function not working correctly

When using nested forms and the bind() function, js validation is performed on 
the nested required 
fields even if the nested form is not activated by the condition.

Original issue reported on code.google.com by [email protected] on 7 Apr 2010 at 2:07

losing session element 'pfbc-instances'

hi again, i'm still trying to use this wonderful class under Joomla!  but
i'm not a strong enough programmer to figure this out.

downloaded the 1.04 version.   (much prefer the CSS approach, thanks).

i'm getting the 'A session is required...' error message from js.php.   but
absolutely have a session, that's not the problem.

so I added the following debug code into js.php just before that message is
posted...  (these look weird, but they end up in javascript)

echo "alert(\"{$_GET["session_name"]}\");"; 
echo "alert(\"$id\");";                      
echo "alert(\"".gettype($_SESSION["pfbc-instances"])."\");"; 

the session_name is something like '50cb5e5e10faa4c47ca1c6437c2f7d09'. 

$id correctly has string 'form_elements'.
but the session element 'pfbc-instances' is NULL.

so i added this line in another part of the program...

echo "<pre>".htmlentities(print_r($_SESSION["pfbc-instances"],true))."</pre>";

and got a valid value that start like
array
(
 [form_elements] => O:4:"form":60:{s:13...
)

i peeked into class.form.php where you set &session_param, and it is being
set correctly to '50cb5e5e10faa4c47ca1c6437c2f7d09'

the generated HTML includes the javascript statement

css.href =
'/community2/components/com_agenda/assets/php-form-builder-class/includes/css.ph
p?id=form_elements&session_name=50cb5e5e10faa4c47ca1c6437c2f7d09';


i use $_SESSION in my other code without issues.

any suggestions?  
thanks in advance.

Original issue reported on code.google.com by [email protected] on 9 May 2010 at 12:49

tiny_mce runtime error

Hello,

There is an error when you do $form->addWebEditor

Code is inserted into the page that looks like:

        tinyMCE.init({
            mode: "textareas",
            theme: "advanced",
            plugins: "safari,table,paste,inlinepopups",
            dialog_type: "modal",
            theme_advanced_buttons1:
"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,ju
stifyfull,|,bullist,numlist,|,outdent,indent,|,forecolor,backcolor",
            theme_advanced_buttons2:
"formatselect,fontselect,fontsizeselect,|,pastetext,pasteword,|,link,image",
            theme_advanced_buttons3: "tablecontrols,|,code,cleanup,|,undo,redo",
            theme_advanced_toolbar_location: "top",
            editor_selector: "tiny_mce",
            forced_root_block: false,
            force_br_newlines: true,
            force_p_newlines: false,
        });
        tinyMCE.init({
            mode: "textareas",
            theme: "simple",
            editor_selector: "tiny_mce_simple",
            forced_root_block: false,
            force_br_newlines: true,
            force_p_newlines: false,
        });

There is an extra comma on the last line on the options on both functions
which causes issues, so instead of:

force_p_newlines: false,

it should be

force_p_newlines: false

Original issue reported on code.google.com by [email protected] on 1 Feb 2010 at 12:05

Web Editor IE Error

What steps will reproduce the problem?
1.  Adding web editor field type to form.
2.
3.

What is the expected output? What do you see instead?
Expected output is a web editor with MS Word like controls.  Instead, the page 
is loaded with a js error and a white screen.

Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 18 Dec 2009 at 2:35

google map bug of 1.0

What steps will reproduce the problem?
1.$form->addLatLng("xxx:", "xxx", array(22.335836,114.181777), 
array("latlngZoom" => 15, "latlngHeight" => 400, "latlngWidth" => 600, 
"latlngHideJump" => 0));
2.
3.

What is the expected output? What do you see instead?
Undefined index: class in /xxxxx/formbuilder/class.form.php on line 1924

What version of the product are you using? On what operating system?
1.0

Please provide any additional information below.

also, may i know how to control the output datatype?
like the format of date range?

Original issue reported on code.google.com by [email protected] on 9 Mar 2010 at 6:30

Use jQuery/jQuery-ui google hosted CDN

Perhaps we should by default use the google hosted copies of jquery.

We should still allow for the user to change the jquery path so they can
use there own, or the one included in the class package.

We could directly link to the jquery librarys that google hosts, or we can
use the google ajax libraries api properly:

http://code.google.com/apis/ajaxlibs/

(direct current links)
https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js

Original issue reported on code.google.com by [email protected] on 27 May 2010 at 4:50

Allow the user to specify custom validation on fields

We should allow the user to validate fields for specific content, we could
have in the $additionalParams a new validate variable that can be set.

We could use the filter types that php make available:
http://www.php.net/manual/en/filter.filters.validate.php

Then the user could do something like:

$addTextbox("Validate me" , "validate" , "" , Array(
"validate" => Array( FILTER_VALIDATE_REGEXP , Array( "regexp" => "/^M(.*)/"
) ), "errorMsg" => 'failed to pass validation')
);

Although this is terribly ugly.

We could only allow for regex validation/callback function, and just have
more things like addEmail()

Original issue reported on code.google.com by [email protected] on 27 May 2010 at 6:17

Tooltip image tag not w3c valid

According to www.w3.org the tooltip img tag created by formbuild is not
XHTML valid.
A solution is to change line 1313 of class.form.php (v.0.9.7) in this way:

$str .= ' <img id="' . $tooltipID . '" src="' . $this->tooltipIcon . '"
alt="tooltip" />';


Original issue reported on code.google.com by [email protected] on 5 Feb 2010 at 3:47

Changelog

Please, could you provide also a changelog when a new release of this good
project comes out?




Original issue reported on code.google.com by [email protected] on 29 Jan 2010 at 1:17

Problem with Checkbox & multiple options

What steps will reproduce the problem?
1. Create form, Add Checkbox with multiple values (by example monday to sunday)
2. Select multiple, or just one option
3. Submit Form

What is the expected output? What do you see instead?
It should verify the checked items and put them back. Instead I get a
warning that the checkbox field is required.


What version of the product are you using? On what operating system?
latest

Please provide any additional information below.
I checked/debugged the class and with a checkbox with multiple values, the
submit form will pass the values in the REQUEST array as an array of
values. Apparantly the class has issues parsing these array values?

Original issue reported on code.google.com by [email protected] on 2 Jun 2010 at 8:32

Animated Captcha Class is useless

Hi,

The animated captcha is not a good one, it has only 125 different solutions
by default... and if you leave it with the default images it is far too
easy to break.

I have attached my solution to this captcha in PHP

I'm just checking the SHA1 of the images against a lookup table. So it will
only work if the images are the default ones...

But it shows that there are quite a few things that need to be changed to
make this captcha difficult...

I would advise you drop this captcha and use something better like recaptcha.

Original issue reported on code.google.com by [email protected] on 28 Jan 2010 at 4:31

Attachments:

PHP Validation should be automatic/cleaner

Hello,

At the moment i think the php validation code, at least the way its done in
the example is too messy, especially when you have the captcha verification
code as well.

It would be good if the php validation could be completely built in and
automated, perhaps when a form is submitting to itself, or an option to
turn on php validation that will automatically serialize the form for you
when you do the render method. The captcha verification should be automated
as well, since if you add a captcha you would expect it to check it. 

I have modified the form to do some automated checking, but at the moment I
don't have a copy to see exactly what I did. Tommorow ill post my
modifications and how creating a php validated form looks with those changes.

Also, thanks for your consistently fast responses, I hope you don't find my
suggestions attempts to be helpful annoying... 

Original issue reported on code.google.com by [email protected] on 25 Feb 2010 at 4:31

IE Focus Bug

IE will throw a js error when setting the focus of the first form element if 
the form's container is 
hidden.

Original issue reported on code.google.com by [email protected] on 28 Apr 2010 at 3:19

TinyMCE Bug

TinyMCE editor always goes back to the simple version (even when using the
advanced version) when toggling between visual and html modes.

Original issue reported on code.google.com by [email protected] on 1 May 2010 at 4:16

Can't Set DateFormat on Date

Hi,

There should be an option to set the dateFormat for the date method.

You should be able to do something like:

    $form->addDate("Date:", "date", "", array("dateFormat" => 'dd/mm/yy'));

Here is my patch to add this feature:

line 1532:
                    $jqueryDateIDArr[] = $ele->attributes["id"];
                    $jqueryDateFormat[] = $ele->attributes["dateFormat"];

line 2031:
            if(!empty($jqueryDateIDArr)) {
                $dateSize = sizeof($jqueryDateIDArr);
                for($d = 0; $d < $dateSize; ++$d) {
                    if( $jqueryDateFormat[$d] != '' ) {
                        $str .= "\n\t\t\t" . '$("#' . $jqueryDateIDArr[$d]
. '").datepicker({ dateFormat: "'. $jqueryDateFormat[$d] .'",
showButtonPanel: true });';
                    } else {
                        $str .= "\n\t\t\t" . '$("#' . $jqueryDateIDArr[$d]
. '").datepicker({ dateFormat: "MM d, yy" , showButtonPanel: true });';
                    }
                }
            }

Original issue reported on code.google.com by [email protected] on 3 Mar 2010 at 3:36

Create report/confirmation after submit

Hi,

It would be really nice if you would be able to present the user with the
form they just filled out with their answers for them to check and confirm.

So what I imagine is doing something like:

    $form = unserialize($_SESSION["reg_form_class"]);
    $form->renderFinal();

and then you would get something similar to $form->render(); except without
forms, and maybe with an option

    $form->renderFinal(array("confirm" => 1));

and will print a confirmation button.

Original issue reported on code.google.com by [email protected] on 27 Jan 2010 at 4:34

Enter text/html directly into the form

Hi,

Sometimes in a form you may want to write some instructions or other
information to explain the next few fields.

So i've created a addHTML method to the form so you may insert any html you
want somewhere in the form.

I've attached my customization to the class.form.php, which is just:

line 566
    public function addHTML( $value="" ) {
        $this->addElement("", "", "html", $value, "");
    }

line 2094
                } elseif($eleType == "html") {
                    $str .= $ele->attributes["value"] ."\n";
                }

Please advise if i've done anything wrong with this :-)

Original issue reported on code.google.com by [email protected] on 27 Jan 2010 at 5:39

Attachments:

render method should return content instead of just echo

Hi,

At the moment when you do $form->render(); it simply just echo's the form,
if a user wanted to place the form somewhere particular into a template or
something like that he cannot pass the form to his function or whatever
else he may want to do.

So, perhaps it would be better if the rendor() method would return the form
content, that way can do:

$maincontent .= $form->render();

and later on they may print out $maincontent,

People can still do it the old way by doing echo $form->render();

line 1110:
    echo $content;
line 1110:
    return $content;

The obvious downside is this will break everyone's form who may upgrade.

Another solution would be to have a parameter for the render function...

line 701:
    public function render($return=FALSE) {
line 1110:
        if($return == TRUE) 
            return $content;
        else
            echo $content;

Thanks,
moncojhr

Original issue reported on code.google.com by [email protected] on 4 Feb 2010 at 2:05

php-form-builder-class doesnt generate valid XHTML

Hi, 

I posted this in the other issue, but thought you might not see it and this
probably deserves its own issue.

I've tried to update the class to XHTML strict specifications...

I think i've fixed most of the things but there is one main problem still,
for lines
like:

<script type="text/javascript" src="../jquery/jquery-1.3.2.min.js"></script>

with XHTML it seems you need to have this in the head tag and not in the
body, so im
not sure what the best way to go about fixing this...

Maybe we can do something where the users have to do:

<head>$form->getHead();</head>

I've attached my class file and below i'll paste my edits...

" selected"
" selected='selected'"

" checked"
" checked='checked'"

<br>
<br />

search for:
<input
find >
change />

Lines:
1373
1396
1566
1618
1736
1805
1875
1871
2005
2009
2011
2396 


1918 ->
                        $str .= "</ul>\n";
                        $str .= "<li></li></ul>\n"; //otherwise it needs to self-close the ul
when
there are no items


<link
/>
 lines:
2162
2177
2183


edit:
<img
/>

lines:
1486

Original issue reported on code.google.com by [email protected] on 8 Feb 2010 at 2:39

Attachments:

Predefined form elements

Some predefined form elements:

* phone number; ( US vs. Non-US) box(412)-box(555)-box(1212)
$form->addUSPhone();
$form->addEPhone(); 

* Address:  Like the example except some easier to call.
$form->addAddress();




Original issue reported on code.google.com by [email protected] on 10 May 2010 at 2:17

onclick submit, on radio options



I am trying to submit the form, (ajax) , when user clicks on any radio 
option. I have tried this:
http://groups.google.com/group/jquery-
en/browse_thread/thread/e66ec974ed2c57e3/dae2b489f7aa986d

did not work.

Also I am trying to change the location of the submit button, instead of 
bottom on the top, or multiple submit buttons. Unable to implement that, so 
far. 

Need your help. 

Thanks for this incredibly useful class.

Original issue reported on code.google.com by [email protected] on 16 Jan 2010 at 6:57

Cant specify custom configuration file for ckeditor

If you want a specific toolbar setup or set other ckeditor settings you can
pass ckeditor a custom js file with the settings you need. We need a
setting to pass our configfile setting to ckeditor within the form builder
class.

Here is a solution:

78:
    protected $ckeditorPath;            /*Allows ckeditor directory's location
to be identified.*/
        protected $ckeditorCustomConfig;                /*Specify location
of custom ckeditor config file*/


2620:
                $ckeditorID = str_replace('"', '&quot;', $ckeditor->attributes["id"]);
                                if(!empty($this->ckeditorCustomConfig))
                                {
                    $str .= "\n\t\t" . 'CKEDITOR.replace("' . $ckeditorID . '", {
customConfig: \'' . $this->ckeditorCustomConfig . '\'}';
                    if(!empty($this->ckeditorLang))
                        $str .= ', { language: "' . $this->ckeditorLang . '" }';
                    $str .= ");";
                                } else
                if(!empty($ckeditor->ckeditorBasic))



To use it:

        $form->setAttributes(array(
                "ckeditorPath" => "../ckeditor",
                "ckeditorCustomConfig" => "../ckeditor/myconfig.js"
        ));

Cheers,
moncojhr

Original issue reported on code.google.com by [email protected] on 1 Apr 2010 at 2:47

Grouping of fields in form, with line/title

What steps will reproduce the problem?
1. Add Fields To Form
2. Use Map Variable to perform layout
3. Layout still not easy to distinguish

What is the expected output? What do you see instead?
Should be able to add fields in a specific group with title. By example for
a registration form, a group for address fields, a group for contact person
information, ... It then should be parsed like this (by example) TITLE,
underline, fields.

What version of the product are you using? On what operating system?
latest

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 1 Jun 2010 at 6:59

Multilanguage Replies

It would be nice to have the replies
in different languages.

Maybe at the beginning a command like this:
$form->setLanguage("german")

Or a cvs file to load
$form->setLanguage("mylanguage.csv")

"submit";"Senden"
" is a required field.";" ist ein Pflichtfeld."
"The CAPTCHA solution was incorrect.";"Die CAPTCHA Eingabe ist falsch"
"We weren't able to verify the public key.";"Der öffentliche Schlüssel
konnte nicht verfiziert werden"


Original issue reported on code.google.com by [email protected] on 10 Feb 2010 at 4:04

XSS in examples

Sorry to be a pain, but some people might upload the examples onto their
site, and the XSS flaws in the examples may lead to compromise of other
things hosted on their site.

So I think its necessary to fix these, here are my fixes: 

php_validation.php
line 24:
    echo("<div style='text-align: center; font-weight: bold; color:
#990000;'>" . htmlentities($_GET["error_message"]) . "</div>");

custom.php
elements.php
googlecodeissue_2.php
googlecodeissue_5.php
googlemaps.php
jquery.php
prefilling.php
screenshot.php
structure.php
styling.php
tooltip.php
webeditor.php
line 7:
    echo htmlentities(print_r($_POST,true));

Thanks,
moncojhr

Original issue reported on code.google.com by [email protected] on 28 Jan 2010 at 6:37

Checkbox value array strong typing

When you try to give an array of values to the checkbox method, it does
type checking. 

Line 1395:
if((!is_array($ele->attributes["value"]) && $ele->attributes["value"] ==
$ele->options[$o]->value) || (is_array($ele->attributes["value"]) &&
in_array($ele->options[$o]->value, $ele->attributes["value"], true)))
                                $str .= ' checked="checked"';

If you look just at this part: 
in_array($ele->options[$o]->value, $ele->attributes["value"], true)

The true parameter makes in_array only return true if the types are the same.

Should we turn this off? Maybe there is a good reason for it to be turned
on that I didn't think of.

Original issue reported on code.google.com by [email protected] on 20 May 2010 at 3:38

GET Vs POST detection fr form submission

Love the class but I encountered a problem with the logic the class uses to
determine if the form was submitted by POST or GET in function validate().

 It assumes if $_GET is not empty that the form is being submitted via a
GET rather than a post. This logic causes problems when the form is POSTed
from a page with a url which contains get vars = eg
localhost/index.php?page=page_with the_form_on_it 

Would like to suggest two solutions :
1) Reverse the check order so POST is checked before GET
or
2) Maybe check !empty( $_GET['submit'] ) instead of !empty($_GET)

Original issue reported on code.google.com by [email protected] on 7 Apr 2010 at 4:37

Missing Info-Output

I'm missing a method just to give 
a output as a headline with no input.

$form->addInfoLine("Text Text")

Or maybe like this:

$form->addInfoLine("<h1>Text Text</h1>")

Original issue reported on code.google.com by [email protected] on 10 Feb 2010 at 3:21

Support optgroup

The user should be able to use optgroup to nest drop down button text
selection.

You should be able to nest optgroups.

I've assigned this one to myself, since i've already partially implemented it.

Original issue reported on code.google.com by [email protected] on 21 May 2010 at 7:36

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.