I have a form that allows a user to paste the code for an HTML form into a textarea. I then store the form they pasted in a string.
Before I echo that form back into my page template I want to change the value of the submit button.
Currently I am using jQuery to do this, but I would like to do it server side first.
Here is my jQuery Code:
$("input[type='submit']").attr("value","my new value");
How would I search the string for that value using PHP and switch it out before the form is printed?
UPDATE: To clarify, I am trying to search a string for:
<input type="submit" value="old value" />
and replace it with
<input type="submit" value="new value" />
the string has a whole form inside it like this:
$string = '<form>
<input type="text" value="any">
<input type="submit" value="old value">
</form>';