Jump to content

Question modifying configureproduct.tpl to remove NS1 and NS2 questions


encieno

Recommended Posts

Hi I'm trying to modify the dedicated server/VM order form, and have modified the configureproduct.tpl in order to remove NS options. I've done that and it works, except when you fill out the form and try to submit it, it returns and says " You must enter a prefix for both nameservers"... I can't figure out where that's checking it out. Anyone have an idea?

 

Thanks

Link to comment
Share on other sites

You can't remove the fields entirely. What you'll need to do is make then hidden input fields instead. Something like the following:

 

Existing:

{if $productinfo.type eq "server"}
<tr><td colspan="2"><strong>{$LANG.cartconfigserver}</strong></td></tr>
<tr class="orderheadingrow"><td colspan="2"></td></tr>
<tr class="orderrow1"><td>{$LANG.serverhostname}</td><td><input type="text" name="hostname" size="15" value="{$server.hostname}" /> eg. server1(.yourdomain.com)</td></tr>
<tr class="orderrow2"><td>{$LANG.serverns1prefix}</td><td><input type="text" name="ns1prefix" size="10" value="{$server.ns1prefix}" /> eg. ns1(.yourdomain.com)</td></tr>
<tr class="orderrow1"><td>{$LANG.serverns2prefix}</td><td><input type="text" name="ns2prefix" size="10" value="{$server.ns2prefix}" /> eg. ns2(.yourdomain.com)</td></tr>
<tr class="orderrow2"><td>{$LANG.serverrootpw}</td><td><input type="password" name="rootpw" size="20" value="{$server.rootpw}" /></td></tr>
<tr class="orderheadingrow"><td colspan="2"></td></tr>
<tr><td height="10"></td></tr>
{/if}

 

Suggestion:

{if $productinfo.type eq "server"}
<tr><td colspan="2"><strong>{$LANG.cartconfigserver}</strong></td></tr>
<tr class="orderheadingrow"><td colspan="2"></td></tr>
<tr class="orderrow1"><td>{$LANG.serverhostname}</td><td><input type="text" name="hostname" size="15" value="{$server.hostname}" /> eg. server1(.yourdomain.com)
<input type="hidden" name="ns1prefix" value="ns1" />
<input type="hidden" name="ns2prefix" value="ns2" />
</td></tr>
<tr class="orderrow2"><td>{$LANG.serverrootpw}</td><td><input type="password" name="rootpw" size="20" value="{$server.rootpw}" /></td></tr>
<tr class="orderheadingrow"><td colspan="2"></td></tr>
<tr><td height="10"></td></tr>
{/if}

Link to comment
Share on other sites

  • 4 months later...

Hi all,

 

Just thought I would follow on from this. We didnt want the whole of that table showing which included Domain, Name Servers and Root Password. You can't remove it and you can't just change the product type as it throws up validation errors when you submit the form even though the fields aren't showing. Anyway, we simply did the following and it solves the problem, no fields showing and no validation issues.

 

Old:

   <tr>
     <td><table width="100%" border="0" cellpadding="10" cellspacing="0">
         <tr>
           <td width="150" class="fieldarea">Hostname:</td>
           <td><input type="text" name="hostname" size="15" value="" />
             eg. server1(.yourdomain.com)</td>
         </tr>
         <tr>
           <td width="150" class="fieldarea">NS1 Prefix:</td>
           <td><input type="text" name="ns1prefix" size="10" value="" />
             eg. ns1(.yourdomain.com)</td>
         </tr>
         <tr>
           <td width="150" class="fieldarea">NS2 Prefix:</td>
           <td><input type="text" name="ns2prefix" size="10" value="" />
             eg. ns2(.yourdomain.com)</td>
         </tr>
         <tr>
           <td width="150" class="fieldarea">Root Password:</td>
           <td><input type="password" name="rootpw" size="20" value="" /></td>
         </tr>
       </table></td>
   </tr>

 

New:

<tr><td>
<input type="hidden" name="hostname" size="1" value="N/A" />
<input type="hidden" name="ns1prefix" size="1" value="N/A" />
<input type="hidden" name="ns2prefix" size="1" value="N/A" />
<input type="hidden" name="rootpw" size="2" value="N/A" />
</td></tr>

 

Anyway, hope its of help and if you have any questions then please give me a shout.

Kind regards,

 

Matthew

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