Zen Cart Logo
Forums / Features Wish List / Clearing default text on click

Clearing default text on click

Views: 25

Results 1 to 3 of 3
22 Feb 2021, 13:16
#1
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Clearing default text on click

On the Admin order details page there are a number of text boxes pre-filled with default text. Depending on the payment method these do not behave in a consistent way i.e. the default text does not always clear on first click:

PayPal EC, these do not clear on click

Partial Refund: 'enter amount'
Voiding Order Authorizations: 'enter auth ID'

Square Payments, this does clear on click

Refund Transaction: 'amount'

I don't have an uncaptured order to hand but from memory there are similar fields there that do not clear.

It would be useful if the default text could clear on the first click in the box, in all instances. In my case orders are pretty sporadic so I often start typing an then realise I should have cleared first.

22 Feb 2021, 13:20
#2
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Clearing default text on click

simon1066:

On the Admin order details page there are a number of text boxes pre-filled with default text. Depending on the payment method these do not behave in a consistent way i.e. the default text does not always clear on first click:

PayPal EC, these do not clear on click

Partial Refund: 'enter amount'
Voiding Order Authorizations: 'enter auth ID'

Square Payments, this does clear on click

Refund Transaction: 'amount'

I don't have an uncaptured order to hand but from memory there are similar fields there that do not clear.

It would be useful if the default text could clear on the first click in the box, in all instances. In my case orders are pretty sporadic so I often start typing an then realise I should have cleared first.

Mucked the previous post up a bit. In the above example the Square 'amount' does not clear on click but does so on typing - this is fine, so the title of my post should probably have been 'Clearing Default Text on Typing', likewise the content should have referred to typing not click.

22 Feb 2021, 13:42
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Clearing default text on click

So looks like as new features were "incorporated" into the core of ZC that some of those were not out right adopted in some places such as described above... did a little searching through the code for examples of what offers the "replaceable" text as compared to what is described as problematic.

This is an example of what may be desired:

$placeholder = zen_output_string_protected(isset($_GET['search_orders_products']) && !empty($_GET['search_orders_products']) ? $_GET['search_orders_products'] : HEADING_TITLE_SEARCH_PRODUCTS); 
Line # 476 :                 ?> 
Line # 477 :               <div class="input-group"> 
Line # 478 :                   <?php 
Line # 479 :                   echo zen_draw_input_field('search_orders_products', '', 'id="searchProduct" class="form-control" aria-describedby="helpBlock3" placeholder="' . $placeholder . '"');

This is an exmple of one of the reported areas,
where the part that is needed to give the "ghosted" text is in that third parameter and would just need to incorporate the parameters necessary to achieve the desired look and feel:

$outputCapt .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_TRANS_ID . '<br />' . zen_draw_input_field('captauthid', 'enter auth ID', 'length="32"') . '<br />';
```