Google Ads

Javascript conditions for country and state RSForm Component  E-mail
Written by Cathy Hayes   
Friday, 20 March 2009 04:57
For good form to use in your website, I reccomend RSForm Pro. It is commercial and costs about 9 euros. It is very easy to use but you need to know some javascript or some sort of server side scripting to really get what you want. Below here is my simple tutorial on how to by default disable the state dropwown list unless the country selected is USA.
1.) Install RSForm pro
2.) create fields for country and state
3.) Put the following code in your additional attribute for country:
onChange="checkEnableState(this);"
4.) Put disabled under additional attribute for state
5.)Uncheck the auto generate layout under Form Layout tab and put these codes below:
function checkEnableState(country) { var s = document.getElementById("state"); if (country.value=="United States of America") { s.disabled = false; } else { s.disabled = true; } }
Thats it!
Last Updated on Friday, 20 March 2009 05:07