• Resolved recepbala

    (@recepbala)


    i set columns as text. now they are multiline text. how can i make them single line text ? ( frant-end and back-end )

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @recepbala,

    Could you give us more details about what you’re trying to achieve?

    Is this for columns on Data Publisher?

    Could you send us the link to your table as well?

    Looking forward to your response! 🙂

    Thread Starter recepbala

    (@recepbala)

    name, middle name, surnames are columns as text type. but they appear as multiline text box. they better be single line text box for sure. you can check images.

    text fields
    https://prnt.sc/heuWAqSMn1R8

    table designer
    https://prnt.sc/05yJQ-hwYwfP

    • This reply was modified 1 year, 5 months ago by recepbala.
    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @recepbala,

    All columns of type text are automatically shown as multi line fields. Please switch from Basic Design Mode to Advanced Design Mode in the Data Designer to get access to more detailed column settings. Then change your column type to varchar and define a max length (200 characters for example). Save your design and click the alter table button to update the physical table.

    Please let us know if this helps,
    Peter

    Thread Starter recepbala

    (@recepbala)

    there is one more thing that i could not handle 🙂
    recorddate and lastupdate columns got their default values are set at designer.
    but when i enter new record, those columns are recorded empty
    using mysql / MyISAM

    Thread Starter recepbala

    (@recepbala)

    varchar did work, thanks 🙂

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @recepbala,

    Good you fixed the varchar issue. Can you share your create table script regarding the empty columns? Please use the contactform on the plugin website if you prefer to share this informaiton in private.

    How do you enter your data?

    Thanks,
    Peter

    Thread Starter recepbala

    (@recepbala)

    data entered from front end and back end and no difference 🙁

    table designer
    https://prnt.sc/05yJQ-hwYwfP

    mysql
    https://prnt.sc/DZhk1A_ilJgP

    SQL / create table script
    CREATE TABLE customers
    (customer_id int(11) NOT NULL auto_increment
    ,recorddate datetime NULL DEFAULT CURRENT_TIMESTAMP
    ,lastupdate datetime NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
    ,customer_name varchar(50) NOT NULL
    ,customer_middlename varchar(50) NULL
    ,customer_lastname varchar(50) NOT NULL
    ,customer_country varchar(50) NOT NULL
    ,PRIMARY KEY (customer_id)
    ) ENGINE MyISAM DEFAULT CHARACTER SET utf16 COLLATE=utf16_unicode_ci;

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @recepbala,

    Thanks for explaning!

    Your code works when you execute an insert from SQL. But it does not work from a default data entry form. The date fields in your form have their own (empty) value which will be saved on commit.

    To solve this issue you need to create a template for your table and give your date fields default value $$NOWDT$$. This is documented here:
    https://wpdataaccess.com/docs/project-templates/data-entry/

    This will enter the default value but also allow the user to overwrite it. You can prevent this by removing these fields from your form (just disable the visible checkbox for both fields). A database trigger would solve this as well.

    Does this solve the issue?
    Peter

    Thread Starter recepbala

    (@recepbala)

    thank you

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Text Fields’ is closed to new replies.