Reply
Thu 13 Jul, 2017 11:33 am
How can I display a decoded # uri symbol on
a textbox. To explain myself better, I'm using an
Onclick button that posts its button value
on a textarea. When the button value is
posted on the text I've added another
button that transfers the textarea value
to the native sms application. My button
value is currently set to %23 and on onclick
posts the (%23) on the textarea which is
later submitted as # in the native sms
application. If that's not possible, can i still use the # symbol and then get the code to replace the # symbols that will be inputted in the textarea with %23 on submit.
This is a snippet of my code :
<!DOCTYPE html>
<form name="test" ENCTYPE="text/plain">
<br><input type="hidden" name="phonenumber" value="79079" disabled />
<textarea class="scrollabletextbox" name="message" id= "tal" autocomplete="off" maxlength="100" style= "width:310px; height:5%" > </textarea>
<script>
document.addEventListener( 'DOMContentLoaded' , start, false);
function start(){
document.getElementById( "button0" ).addEventListener
( "click" , function(){addText( this );} );
document.getElementById( "button1" ).addEventListener
( "click" , function(){addText( this );} );
function addText(elem) {
document.getElementById( "tal" ).value += elem.value;
}
};
</script>
<body>
<script type="text/javascript">
var ComposeSMS = function(){
var contactno = document.test.phonenumber.value;
var messagetext=document.test.message.value;
window.location.href = "sms:"+contactno+"?body="+messagetext;
}
</script>
<input onclick="ComposeSMS();" type="button" value=" Send"/><p><p>
<p><p>To Send<p>
<button name="#" type="button" id= "button0" value ="%23"/>0</button>
<button name="1" type="button" id= "button1" value ="1"/>1</button>
</html>