WordPress.org

Forums

Fast Secure Contact Form
insert the URL or name of the current domain in a text field (10 posts)

  1. Atout
    Member
    Posted 4 years ago #

    Hello,

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

    Thanks

  2. Mike Challis
    Member
    Plugin Author

    Posted 4 years ago #

    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.

  3. Atout
    Member
    Posted 4 years ago #

    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

  4. Atout
    Member
    Posted 4 years ago #

    Re,

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

  5. Mike Challis
    Member
    Plugin Author

    Posted 4 years ago #

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

  6. Atout
    Member
    Posted 4 years ago #

    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">
  7. Mike Challis
    Member
    Plugin Author

    Posted 4 years ago #

    Do you have a URL I can see?

  8. Atout
    Member
    Posted 4 years ago #

    For the moment no, I work localhost

  9. Atout
    Member
    Posted 4 years ago #

    Hello,

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

    A+

  10. Atout
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Fast Secure Contact Form
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic