WordPress.org

Support

Support » Plugins and Hacks » Fast Secure Contact Form » insert the URL or name of the current domain in a text field

insert the URL or name of the current domain in a text field

  • Hello,

    Is it possible to insert the URL or name of the current domain in a text field ?

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mike Challis

    @mikechallis

    Yes if you want to make your own javascript to insert it.
    Here is a sample of how to fill a field, you have to match the field name correctly and figure out how to get the URL for ‘url goes here'(I do not know).

    <script type="text/javascript">
    document.getElementById('si_contact_ex_field13_1').value='url goes here';
    document.getElementById('si_contact_ex_field13_1').readOnly='readOnly';
    </script>

    But it is already included in the email message you get.
    Look at the bottom of the email: “Coming from (referer)” is the URL the form was posted from.

    Re,

    Thank you for your quick response.
    In fact I am not sending emails, I store and for now I’m testing your plugin locally (in my opinion the best today)
    At which point, I can put this javascript code on the form?
    Hervé
    Sorry for my bad English

    Re,

    Since I want it back automatically, is it would not be possible to recover more value in php :
    eg: $ _SERVER [‘HTTP_HOST $]

    Plugin Author Mike Challis

    @mikechallis

    The javascript can go in the WP page just before the shortcode.

    Well it does not work.
    I noticed the inversion for the id: si_contact_ex_field1_8

    So I put this before the shortcode:

    <script type="text/javascript">
    document.getElementById('si_contact_ex_field1_8').value='toto.fr';
    </script>

    HTML rendering of this field is :

    <input gtbfieldid="97" style="text-align: left; float: left; padding: 2px; margin: 0pt;" id="si_contact_ex_field1_8" name="si_contact_ex_field8" value="" size="39" type="text">

    Plugin Author Mike Challis

    @mikechallis

    Do you have a URL I can see?

    For the moment no, I work localhost

    Hello,

    I put the javascript after the form and it works;-)

    A+

    Hello
    It works with a text field but not with a hidden field.
    Have you any idea?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘insert the URL or name of the current domain in a text field’ is closed to new replies.
Skip to toolbar