• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: set input type for each field

set input type for each field 9 years 10 months ago #31492

  • gckuntz
  • gckuntz's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I can't figure out how to give each field it's own input type.
version: Rsfrom pro 1.50.14
responsive (css3) layout

for example
field telephone --> input type="tel"
field email --> input type="email"

Can someone help me out.
Thanks in advance
The administrator has disabled public write access.

set input type for each field 9 years 10 months ago #31503

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
You can easily achieve this with a jQuery script and an Additional Attribute. For example, head over to the email field and in the Additional Attributes add data-type="email".

Head over to the CSS and Javascript section, and in the Javascript textarea insert the following
<script>
 
jQuery(document).ready(function($){
	// we grab all the fields
	var fields = $('#userForm').find('input').not(':input[type=button], :input[type=submit], :input[type=reset], :input[type=hidden], .rsform-captcha-box');
	$(fields).each(function(){
	// get the data-type attribute
		$newType = $(this).attr('data-type');
	// if it's not empty, replace the standard type
		if ($newType != ''){
			$(this).attr('type', $newType);
		}
	});
 
});
 
</script>
My help is not official customer support. To receive your support, submit a ticket by clicking here
Last Edit: 9 years 10 months ago by cosmin.cristea.
The administrator has disabled public write access.
The following user(s) said Thank You: gckuntz
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!