- Posts: 35
- Thank you received: 0
Text field not initialized with value
- Paul Adamson
- Topic Author
- Offline
- Junior Member
Less
More
5 years 3 months ago #128061
by Paul Adamson
Text field not initialized with value was created by Paul Adamson
Hi Tuan, in this file:
/components/com_helpdeskpro/View/fieldlayout/text.php
the code
never sets the value of the field, so when I display the form with a value preset, it is blank. I've corrected it in my version like this:
Cheers
Paul
/components/com_helpdeskpro/View/fieldlayout/text.php
the code
Code:
<input type="<?php echo $type; ?>"
name="<?php echo $name; ?>" id="<?php echo $name; ?>"
value=""<?php echo $attributes; ?> />
never sets the value of the field, so when I display the form with a value preset, it is blank. I've corrected it in my version like this:
Code:
<input type="<?php echo $type; ?>"
name="<?php echo $name; ?>" id="<?php echo $name; ?>"
value="<?php echo $value; ?>"<?php echo $attributes; ?> />
Cheers
Paul
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
5 years 3 months ago #128066
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Text field not initialized with value
Thanks Paul. To prevent xss attack, the code should be changed to:
Regards,
Tuan
Code:
<input type="<?php echo $type; ?>"
name="<?php echo $name; ?>" id="<?php echo $name; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>"<?php echo $attributes; ?> />
Regards,
Tuan
The following user(s) said Thank You: Paul Adamson
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.