Jump to content

Hiding some fields


Osaul

Recommended Posts

Hello,

 

We want to hide some fields in two files: configureproduct.tpl (Hostname, Root Password, NS1 Prefix, NS2 Prefix) and clientregister.tpl (Choose Currency). But if we simply hiding some of this fields, we will receive errors, because billing-system WHMCS requires put in this fields some data. How we can do it correctly?

 

We find

{if $productinfo.type eq "server"}
                           <div class="sub-heading">
                               <span>{$LANG.cartconfigserver}</span>
                           </div>

                           <div class="field-container">

                               <div class="row">
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputHostname">{$LANG.serverhostname}</label>
                                           <input type="text" name="hostname" class="form-control" id="inputHostname" value="{$server.hostname}" placeholder="servername.yourdomain.com">
                                       </div>
                                   </div>
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputRootpw">{$LANG.serverrootpw}</label>
                                           <input type="password" name="rootpw" class="form-control" id="inputRootpw" value="{$server.rootpw}">
                                       </div>
                                   </div>
                               </div>

                               <div class="row">
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputNs1prefix">{$LANG.serverns1prefix}</label>
                                           <input type="text" name="ns1prefix" class="form-control" id="inputNs1prefix" value="{$server.ns1prefix}" placeholder="ns1">
                                       </div>
                                   </div>
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputNs2prefix">{$LANG.serverns2prefix}</label>
                                           <input type="text" name="ns2prefix" class="form-control" id="inputNs2prefix" value="{$server.ns2prefix}" placeholder="ns2">
                                       </div>
                                   </div>
                               </div>

                           </div>
                       {/if}

Replace with

<!-- {if $productinfo.type eq "server"}
                           <div class="sub-heading">
                               <span>{$LANG.cartconfigserver}</span>
                           </div>

                           <div class="field-container">

                               <div class="row">
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputHostname">{$LANG.serverhostname}</label>
                                           <input type="hidden" name="hostname" class="form-control" id="inputHostname" value="NA">
                                       </div>
                                   </div>
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputRootpw">{$LANG.serverrootpw}</label>
                                           <input type="hidden" name="rootpw" class="form-control" id="inputRootpw" value="NA">
                                       </div>
                                   </div>
                               </div>

                               <div class="row">
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputNs1prefix">{$LANG.serverns1prefix}</label>
                                           <input type="hidden" name="ns1prefix" class="form-control" id="inputNs1prefix" value="NA" placeholder="ns1">
                                       </div>
                                   </div>
                                   <div class="col-sm-6">
                                       <div class="form-group">
                                           <label for="inputNs2prefix">{$LANG.serverns2prefix}</label>
                                           <input type="hidden" name="ns2prefix" class="form-control" id="inputNs2prefix" value="NA" placeholder="ns2">
                                       </div>
                                   </div>
                               </div>

                           </div>
                       {/if} -->

And still get errors (Errors.png).Errors.png

 

We want know how we can do it correctly, because on forum there so many different opinions.

Link to comment
Share on other sites

We solved this issue with next:

{if $productinfo.type eq "server"}
                           <input type="hidden" name="hostname" class="form-control" id="inputHostname" value="NA">
                           <input type="hidden" name="rootpw" class="form-control" id="inputRootpw" value="NA">
                           <input type="hidden" name="ns1prefix" class="form-control" id="inputNs1prefix" value="NA" placeholder="ns1">
                           <input type="hidden" name="ns2prefix" class="form-control" id="inputNs2prefix" value="NA" placeholder="ns2">
                       {/if}

Without any additional items.

Link to comment
Share on other sites

Will be better if you specify in this fields some "normal" data, for example:

{if $productinfo.type eq "server"} 
                           <input type="hidden" name="hostname" class="form-control" id="inputHostname" value="edit.example.com"> 
                           <input type="hidden" name="rootpw" class="form-control" id="inputRootpw" value="edit"> 
                           <input type="hidden" name="ns1prefix" class="form-control" id="inputNs1prefix" value="ns1.example.com" placeholder="ns1"> 
                           <input type="hidden" name="ns2prefix" class="form-control" id="inputNs2prefix" value="NA" placeholder="ns2.example.com">
                       {/if}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated