WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Inserting dynamic text in a form button

[Resolved] Inserting dynamic text in a form button

  • Hi – can this be done?

    <p span style=”padding: 10px 0 50px 40px;”><input type=”submit” name=”sendbutton” id=”myButton” class=”myButton” value=[insert_php] if ($_GET[‘kw’])
    {echo ucwords($_GET[‘kw’]);}
    else
    {echo ucwords(‘Default Text’);}
    [/insert_php]></p>

    I’m getting the button that shows the text [insert_php} so apparently the code is not running.

    I know the code works on my site as I’ve entered this into a page.

    I might also add that above code is being run in a TEXT widget.

    Thanks

    http://wordpress.org/plugins/insert-php/

Viewing 1 replies (of 1 total)
  • Plugin Author WillBontrager

    @willbontrager

    drosengarden, Insert PHP will work only in posts and pages.

    Sorry, but it won’t work in the Text widget.

    Otherwise, yes, your code appears that it would work (although I haven’t tested it). Try it in a post or page.

    Will

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Inserting dynamic text in a form button’ is closed to new replies.