- Posts: 272
- Thank you received: 13
Deafault text field issue
- deltafidesign
-
Topic Author
- Offline
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.
Please Log in or Create an account to join the conversation.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
Please Log in or Create an account to join the conversation.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
Please Log in or Create an account to join the conversation.
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.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
Please Log in or Create an account to join the conversation.
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.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
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.
Please Log in or Create an account to join the conversation.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
Is there another solution?
Thanks
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
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.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
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?
Please Log in or Create an account to join the conversation.
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.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
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.
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.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
Please Log in or Create an account to join the conversation.
Did the javascript code did the trick ?
Please Log in or Create an account to join the conversation.
- deltafidesign
-
Topic Author
- Offline
- Posts: 272
- Thank you received: 13
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.