Deafault text field issue

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31390

I try to create a Default text field.

First of all I insert the default text in the text area and I save it. In the registration form it dispay all the text. I edit the field to choose number or rows and cols and then I save again. Now the text disappear both frontend and backend and if I try to insert again the text and then I save no text is shown.

A bug?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31427

Could you do a screenshot of the form before saving it so that we can try to reproduce the error ?

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31444

Cannot do it 'cause I've completly disinstalled Hickashop. But I can tell you that the form before saving is completly different from the form that I see after saving. Before saving I can see only few fields

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31447

Up to my previous post.

I've done a test over a Business version of a Client and I have same result. Here is the screenshot:

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31465

Thank you for the information.

Please change the line:
echo $this->field->field_type;
to:
echo $this->field->field_type.'<input type="hidden" name="data[field][field_type]" value="'.$this->field->field_type.'" />';

in the file "form" of the view "field" via the menu Display->Views and try again. That should solve the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31522

No way, still same issue.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31546

Please make sure that you did your modification for the correct template (it should be for your back end template).

That modification works on our end so it will work on yours too once done properly.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31557

Ok, now it work fine.

Now I try to set row 10 and cols 50 but in the registration form the text is not displayed in a textarea (50x10) but all the texts is displayed.

What's wrong?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31578

That's normal. These row and cols options should not be displayed for the type "custom text". The type custom text only allows you to display text, not a textarea. If you want to display a text area, you should instead use the type textarea and you would be able to set the row and cols options.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31605

Yes, I tryed also this solution before trying with the default text field but I cannot use it for my solution for this reason: I need to show a privacy policy text into a textarea field and then insert a check to accept it; so, if I insert all my privacy policy text in to a text area field as default value in the registration form it displays only a bit part of the text and not the entire text. Also a user can type into that field and I just want to show it without typing.

Is there another solution?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31608

If you put your text as a default value of a text area, you should be able to increase the size of the textarea thanks to the cols and rows options of the field.

However, there is no option to not make it editable by the user. In that case a custom text field could do the job but the text won't be in a textarea, it will directly be displayed on the page.

There is no other solution than these both possibilities using custom fields. Alternatively, you could displayed edit the file "fields" of the view "checkout" via the menu Display->Views and directly add your HTML at the beginning of the file.

Last edit: 12 years 11 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31612

nicolas wrote:

If you put your text as a default value of a text area, you should be able to increase the size of the textarea thanks to the cols and rows options of the field.


Yes, but the problem is that the text is not copletly displayed and not because I need to scroll but 'cause really in the box is shown only some fragments of my text; I mean some sentences only, some words; something like it random take a part of the texts and truncate some words, maybe it can't display a logn text.

Alternatively, you could displayed edit the file "fields" of the view "checkout" via the menu Display->Views and directly add your HTML at the beginning of the file.


Ok, that could work for me but how can I let it work in different languages?

If that's impossible, would you implement in future releases something to solve this problem? I need a kind of field that can contain a long text to be displayed into a textarea in registration form and also in user profile and possibly cannot be editedby user.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31617

deltafidesign wrote:

nicolas wrote:

If you put your text as a default value of a text area, you should be able to increase the size of the textarea thanks to the cols and rows options of the field.


Yes, but the problem is that the text is not copletly displayed and not because I need to scroll but 'cause really in the box is shown only some fragments of my text; I mean some sentences only, some words; something like it random take a part of the texts and truncate some words, maybe it can't display a logn text.

Alternatively, you could displayed edit the file "fields" of the view "checkout" via the menu Display->Views and directly add your HTML at the beginning of the file.


Ok, that could work for me but how can I let it work in different languages?

If that's impossible, would you implement in future releases something to solve this problem? I need a kind of field that can contain a long text to be displayed into a textarea in registration form and also in user profile and possibly cannot be editedby user.

Thanks


Up to my previous post.

Even if I hack the view I don't store a value for that text in the DB and I need to have that data stored into a DB field.

I want to explain better why I need this.

I need this 'cause italian laws request for e-commerce that in every form that requieres personal data is shown the Privacy Policy and also a check to accept this privacy policy. The same must be done for the Terms and conditions. Both completly shown in the registration form (or everywhere registered data are requested, and before checkout for selling conditions) and user must accept them with 2 checks (possibly 2 radio buttons with yes or not; if "not" user cannot register or buy).

You should really consider this 'cause it's necessary for e-commerce in Italy, but most of all to find a solution also for many other countries according to local laws.

What do you think?

Last edit: 12 years 11 months ago by deltafidesign.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31642

Is your text also truncated on the back end ?
If so, it means that your text is more than 250 letters and that the size of the field in the database is not enough.
In that case, you should edit the jos_hikashop_field table via phpmyadmin and change the type of the field from VARCHAR(250) to text. That should allow you to add a text of 65000 letters.
We'll also do that change on our end for next version of HikaShop as it makes sense to allow a bigger default value for special cases like yours.

However, I don't think that you can have the default value of a field in different languages.
You should rather consider the alternative option I gave you of adding your text directly in the view file.
You should just add one line:

<?php echo JText::_('MY_TERMS_AND_CONDITIONS'); ?>

Then, edit your language files via the configuration of HikaShop and add the translations:
MY_TERMS_AND_CONDITIONS="blablabla<br/>blalblabla..."

Then you're done, the system will change automatically your text based on the current language.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #31670

nicolas wrote:

Is your text also truncated on the back end ?
If so, it means that your text is more than 250 letters and that the size of the field in the database is not enough.
In that case, you should edit the jos_hikashop_field table via phpmyadmin and change the type of the field from VARCHAR(250) to text. That should allow you to add a text of 65000 letters.
We'll also do that change on our end for next version of HikaShop as it makes sense to allow a bigger default value for special cases like yours.


Yes, that's my solution at the moment. It works for me but cannot use languages in this case and I cannot set a parameter for "readonly" in the textarea to disallow users to type in it.

However, I don't think that you can have the default value of a field in different languages.
You should rather consider the alternative option I gave you of adding your text directly in the view file.
You should just add one line:

<?php echo JText::_('MY_TERMS_AND_CONDITIONS'); ?>

Then, edit your language files via the configuration of HikaShop and add the translations:
MY_TERMS_AND_CONDITIONS="blablabla<br/>blalblabla..."

Then you're done, the system will change automatically your text based on the current language.


That's not my case,'cause I need to store into a DB field for every user the privacy policy text and the check to accept it and with this solution I just insert a text into the form and not into the DB.

My optimal solution would be to insert the variable "'MY_PRIVACY_POLICY'" into the default field of a textarea field; then choose if "readonly or not" in the backend edit; so I can store into DB for every user the translated text (and they cannot edit it). Do you think you can develope something like that for further releases?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31702

Yes. We'll add that to the todo list.

You could add the readonly to your custom field with a line of javascript at the end of that "fields" view file:

<?php echo "<script type=\"text/javascript\">document.getElementById('TEXTAREA_ID').readOnly = true;</script>"; ?>

Of course, make sure that you replace TEXTAREA_ID by the id of the textarea.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #32126

Any idea about when this will be added? Next relese?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #32159

No idea.

Did the javascript code did the trick ?

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 11 months ago #32224

No, didn't work. Something wrong? I put it at the end of file but do not work.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #32260

Could you give a link so that we can see what you did ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.093 seconds
Powered by Kunena Forum