Announcement

Collapse
No announcement yet.

pre-filled subject heading in contact form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    pre-filled subject heading in contact form

    I want to create a button for each product which generates a separate pop-up containing the contact us form.

    I think I should be able to edit the Act_ContactUs template and add extra fields etc.

    What I really need is the Subject heading to be pre-filled with the name of the Product that it has been clicked from.

    Thanks in advance.

    John
    www.homecreations.co.uk - www.wastedisposershop.com - www.wastemaidshop.co.uk -

    #2
    Make the button link to the contact form, but add the product name to the end of the URL lke this:
    Code:
     <a href="contactform.html?p=NETQUOTEVAR:PRODUCTTITLE"><img src="button.gif" /></a>
    Then, in the contact form page, add an ID tag of "subject" to the Subject text box, something like this:
    Code:
    <input type="text" name="subject" id="subject" />
    Finally, add this code directly underneath the input box:
    Code:
    <script type="text/javascript">
    if ((location.href).match("p=")){
    	document.getElementById("subject").value=(location.href).substring((location.href).lastIndexOf("=")+1,(location.href).length);
    	}
    </script>
    This will set the Subject box to the product name, but won't display anything when the page is linked to normally.

    (I think NETQUOTEVAR:PRODUCTTITLE should get the product name, I'm not at work so I can't check the variable name).
    www.gbradley.co.uk
    Web Development, Actinic Patches, Scripts & more

    Comment


      #3
      Neat solution! Nice one.

      Just for future reference, the variable you need to use is NETQUOTEVAR:PRODUCTNAME

      Comment


        #4
        Thanks for claryfying that one, Chris.

        Something else that I hadn't thought of was dealing with spaces in the product name. So this this code instead:

        Code:
        <script type="text/javascript">
        if ((location.href).match("p=")){
        	document.getElementById("subject").value=decodeURI((location.href).substring((location.href).lastIndexOf("=")+1,(location.href).length));
        	}
        </script>
        www.gbradley.co.uk
        Web Development, Actinic Patches, Scripts & more

        Comment


          #5
          Where does this come in?

          Where does the: 'Just for future reference, the variable you need to use is NETQUOTEVAR:PRODUCTNAME' come in?.

          I am unable to use this form so would be grateful if anyone could help with the correct information

          Thanks

          Andrew

          Comment


            #6
            Chris was correcting my advice in my first reply. If you do the following, you should get it working:

            Make the button in the product template link to the contact form, but add the product name to the end of the URL lke this:
            Code:
             <a href="contactform.html?p=NETQUOTEVAR:PRODUCTNAME"><img src="button.gif" /></a>
            Then, in the contact form page, add an ID tag of "subject" to the Subject text box, something like this:
            Code:
            <input type="text" name="subject" id="subject" />
            Finally, add this code directly underneath the input box:

            Code:
            <script type="text/javascript">
            if ((location.href).match("p=")){
            	document.getElementById("subject").value=decodeURI((location.href).substring((location.href).lastIndexOf("=")+1,(location.href).length));
            	}
            </script>
            www.gbradley.co.uk
            Web Development, Actinic Patches, Scripts & more

            Comment


              #7
              This (untested) idea may be of use too ( http://community.actinic.com/showpos...36&postcount=3 ). It was for someone wanting to pass the product name to an email a friend popup.

              It's a V8 post, but would be easy to amend for V7.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment

              Working...
              X