This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Who to change the case of text fields


  1. timothykrulan
    Member

    I would like to format the case of the text entered into a all text fields so that he first letter of each word is capitolized using some PHP code like:

    $bar = ucwords(strtolower($bar));

    but do not know where to place it?

    Has anyone done this and know where to add the code?

    Posted 12 years ago #
  2. redityo

    You can try edit "post-function.php" file and go to around line 400. You will see this code :

    $table_data[$element_name] = $element_data;

    then you can change the code to be like this

    $table_data[$element_name] = ucwords(strtolower($element_data));

    that would convert your single line text field value capitalized on first letter.


    MachForm Support

    Posted 12 years ago #
  3. timothykrulan
    Member

    Thanks for the quick reply - this worked perfectly!

    Posted 12 years ago #
  4. edbarrios
    Member

    Is possible to apply this only to one id form and a know element_id ?
    Thanks

    Posted 10 years ago #
  5. yuniar

    Yes, you can use conditional logic, like this:

    if($form_id == 1827 && $element_name == 'element_2'){
      $table_data[$element_name] = ucwords(strtolower($element_data));
    }

    On the above sample, your form id number is 1827, while your element name is "element_2"


    MachForm Founder

    Posted 10 years ago #

RSS feed for this topic

Reply