JustScott Posted February 25, 2020 Share Posted February 25, 2020 Hi, We want to append a string, 'xyz.com', to the server. hostname value in our order form. So if customers enters 'bill', it will be saved as 'bill.xyz.com' I've tried just appending and cat, but this doesn't save it to the database. Can anyone provide a clue as to the best way to do this? I'm pretty new to both WHMCS and Smarty. Thanks in advance, Scott <tr><td class="fieldlabel">{$LANG.serverhostname}:</td><td class="fieldarea"><input type="text" name="hostname" size="15" value="{$server.hostname}" /> {$LANG.serverhostnameexample}</td></tr> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 26, 2020 Share Posted February 26, 2020 17 hours ago, JustScott said: Can anyone provide a clue as to the best way to do this? I would have thought JS would be a better option than Smarty for something like this. 0 Quote Link to comment Share on other sites More sharing options...
JustScott Posted February 26, 2020 Author Share Posted February 26, 2020 4 hours ago, brian! said: I would have thought JS would be a better option than Smarty for something like this. Can you elaborate? I'm not sure how js could be used for this. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 27, 2020 Share Posted February 27, 2020 23 hours ago, JustScott said: Can you elaborate? I'm not sure how js could be used for this. by using the Continue button to inject the additional text into the form field and then submit that updated value... 1 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted February 28, 2020 Share Posted February 28, 2020 15 hours ago, brian! said: by using the Continue button to inject the additional text into the form field and then submit that updated value... Brian suggested a good workaround. Have you tried appending xyz.com to `value="{$server.hostname}"` ? value="{$server.hostname}.xyz.com" 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 28, 2020 Share Posted February 28, 2020 1 hour ago, pRieStaKos said: Have you tried appending xyz.com to `value="{$server.hostname}"` ? that would rely on the user adding their hostname before it (as it would be shown in the field) and/or not removing it - if they remove it, then the additional text won't be added on submission. 1 Quote Link to comment Share on other sites More sharing options...
JustScott Posted March 1, 2020 Author Share Posted March 1, 2020 Thanks! I got this working using js. Much appreciated 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.