Click to See Complete Forum and Search --> : How to replace a part of a string in a form field...


listenmirndt
09-05-2008, 11:55 AM
<input type="button" value="Delete" onClick="DeleteThis('~15~')">
<input type="text" name="CATEGORYH" value="~18~~15~~20~">

So when but Delete button is clicked, how could it be done that the CATEGORYH field changes its value to :

<input type="text" name="CATEGORYH" value="~18~~20~">

Thanks!

Weedpacket
09-05-2008, 11:39 PM
JavaScript's String object has a replace() method.