Programmable Voice

  1. Home
  2. Docs
  3. Programmable Voice
  4. WebRTC
  5. Creating Your Own Custom Form

Creating Your Own Custom Form

This form requires 2 variables that can be sent via the get method, which are: phone, and account. ext is an optional get variable.

Code for Sample HTML Form

A sample HTML form would look like this:

  
<form method="get" action="https://ivlrest.voiceelements.com/clickcall">
    <input type="text" id="phone" name="phone" />
    <input type="text" id="ext" name="ext" />
    <input type="hidden" id="account" name="account" value="100" />
    <input type="submit" id="submit" value="submit" />
</form>

NOTE: The client’s web designer should replace the value 100 in the hidden field account with the account number that they are given.

Additional Notes:

The web designer should verify that only numbers are passed in both the phone and ext text boxes to avoid potential errors.

This can be done via javascript by including the following function in the head section:

  
<head>
    <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%0A%20%20%20%20function%20isNumberKey(evt)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20var%20charCode%20%3D%20(evt.which)%20%3F%20evt.which%20%3A%20event.keyCode%0A%20%20%20%20%20%20%20%20if%20(charCode%20%3E%2031%20%26%26%20(charCode%20%3C%2048%20%7C%7C%20charCode%20%3E%2057))%0A%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%0A%3C%2Fscript%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="&lt;script&gt;" title="&lt;script&gt;" />
</head>

And adding the following property to the phone textbox:

   
<input id="phone" name="phone" onkeypress="return isNumberKey(event)" />

Server Side Languages

Using a server side language, such as ASP.NET or PHP, the designer could use separate text boxes to make the form more user friendly.

Was this article helpful to you? Yes 11 No

How can we help?