RSForm!Pro - Anchor point


Tutorials - Tutorials

User Rating: / 0
Anchor point

"I have a form on the bottom of the page and, if the validation fails, the page will reload and get displayed scrolled to the top of the page. "

This drawback can be easily fixed using an anchor point. Basically, an anchor point is simply a generic HTML link (using the <a> tag) placed where you want the page automatically scrolled to when the link is accessed. It will be identified by its name attribute, and it should look like this:

<a name="anchor"></a>

Note that no text needs to be added within the <a> tags. By leaving that space blank, you will render the anchor invisible in the frontend.

Placing the anchor inside the form

We'll do this using a free text form component:

  • Head to Components >> RSForm!Pro >> Manage Forms >> edit your form >> Components >> add a Free Text field to your form's layout
  • in its Text field, add <a name="anchor"></a>

Note: Make sure to place the free text field where you want to have the page automatically scrolled to.

The custom code

We'll be using Javascript to implement the actual functionality that will redirect you to the anchor's position:

  • While editing the form, head to Properties >> CSS and Javascript
  • add the following code in the Javascript area:

  <script> function anchorPoint() { x=document.getElementById("userForm"); x.setAttribute("action","#anchor"); } </script>  


This can be applied for Thank you messages as well. Simply add the anchor point within your Thank you message configuration area.

Calling the Javascript function

The final step is to specify when our custom Javascript function should be executed. The most appropriate time would be when the Submit button is clicked:

  • Head to Components >> RSForm!Pro >> Manage Forms >> edit your form >> Components >> edit the Submit button >> head to the Attributes tab
  • in the Additional Attributes field, add onclick="anchorPoint()"

About Us

Royal Developer Top three Web Designing and Web Development Company in Dehradun, Uttarakhand, India. Royal Developer Best SEO Company in Dehradun takes pride in its philosophy of 'Employee First' which empowers to create a real value for the customers. Royal Developer can offer Best and cheap Website Development Software Development & SEO Services. We are the Best service Provider of SEO, SEM, SMO ServicesCompany in Uttarakhand. Web Designing Course in Dehradun, Web Designing Classes in Dehradun, Web Design Training Institute in Dehradun, Web designing institute in dehradun, Best institute for web designing in dehradun, Web development training in dehradun, Web development course in dehradun, Web Designing Training in Dehradun.


- Contact Information - 

Add : RDIT Services Pvt Ltd, 3rd Floor, RGM Plaza, Above Chandu Canteen,
          23 Chakrata Road, Dehradun - 248001, Uttarakhand, India

Email : 


 : +91 8171200108, +91 8979462451,
                                  +91 7895753921

Quick Enquiry Form

Enter your full name

Enter your valid email address

Enter your correct mobile number

Invalid Input

Your Message
Invalid Input

Enter Code
Enter Code
  RefreshInvalid Input


You are here: Home Tutorials RSForm!Pro - Anchor point