Search code examples
javascriptprepend

javascript add text to string sent to DB


I am using appery.

I want the number in a text input to be sent to a database, which it is. Problem is that I need to add the short text 'Tel:' before the actual number. So the string in the database will sa Tel: XXX(the number).

I have tried now for two days and really can't get it to work even if it seems like an easy task. All it does is that is sends the number. (trying prepend, but obviously doing it wrong)

Any help would be very appreciated!


Solution

  • You can try this

    var number = "tel:" + document.getElementByID("Input_Field_ID").value;
    

    now sent this number (variable) to Database