- Posts: 106
- Thank you received: 1
OS Property support center
Make country & state required during registration?
- kalesh.suby
- Topic Author
- Offline
- Premium Member
-
Less
More
11 years 8 months ago #39869
by kalesh.suby
Make country & state required during registration? was created by kalesh.suby
Hi,
How to make country and state and city required fields during Agent registration?
Thanks
How to make country and state and city required fields during Agent registration?
Thanks
Please Log in or Create an account to join the conversation.
- Dang Thuc Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13244
- Thank you received: 1729
11 years 8 months ago #39874
by Dang Thuc Dam
Replied by Dang Thuc Dam on topic Re: Make country & state required during registration?
Hi,
If you are using version 2.6, please follow these steps
1. Open file components > com_osproperty > helpers > agentregistration.php
2. find
function submitForm(){
var form = document.ftForm;
var name = form.name;
var email = form.email;
var address = form.address;
var userid = <?php echo intval($user->id)?>;
var captcha_agent_register = form.captcha_agent_register;
<?php
if($user->id > 0){
?>
if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}else{
?>
var username = form.username;
var password = form.password;
var password2 = form.password2;
if(name.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_NAME')?>");
name.focus();
return false;
}else if((username.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_UNAME')?>");
username.focus();
return false;
}else if((password.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_PWD')?>");
password.focus();
return false;
}else if((password2.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VPWD')?>");
password2.focus();
return false;
}else if((password.value != password2.value) && (userid == 0)){
alert("<?php echo JText::_('OS_PWDANDVPWDARETHESAME')?>");
password.focus();
return false;
}else if(email.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_EMAIL')?>");
email.focus();
return false;
}else if(! emailValid(email.value)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VALID_EMAIL')?>");
email.focus();
return false;
}else if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}
?>
}
and change to
function submitForm(){
var form = document.ftForm;
var name = form.name;
var email = form.email;
var address = form.address;
var userid = <?php echo intval($user->id)?>;
var captcha_agent_register = form.captcha_agent_register;
<?php
if($user->id > 0){
?>
if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(state.value == ""){
alert("<?php echo JText::_('Please select state')?>");
return false;
}else if(city.value == ""){
alert("<?php echo JText::_('Please select city')?>");
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}else{
?>
var username = form.username;
var password = form.password;
var password2 = form.password2;
if(name.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_NAME')?>");
name.focus();
return false;
}else if((username.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_UNAME')?>");
username.focus();
return false;
}else if((password.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_PWD')?>");
password.focus();
return false;
}else if((password2.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VPWD')?>");
password2.focus();
return false;
}else if((password.value != password2.value) && (userid == 0)){
alert("<?php echo JText::_('OS_PWDANDVPWDARETHESAME')?>");
password.focus();
return false;
}else if(email.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_EMAIL')?>");
email.focus();
return false;
}else if(! emailValid(email.value)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VALID_EMAIL')?>");
email.focus();
return false;
}else if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(state.value == ""){
alert("<?php echo JText::_('Please select state')?>");
return false;
}else if(city.value == ""){
alert("<?php echo JText::_('Please select city')?>");
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}
?>
}
Thanks
Dam
If you are using version 2.6, please follow these steps
1. Open file components > com_osproperty > helpers > agentregistration.php
2. find
function submitForm(){
var form = document.ftForm;
var name = form.name;
var email = form.email;
var address = form.address;
var userid = <?php echo intval($user->id)?>;
var captcha_agent_register = form.captcha_agent_register;
<?php
if($user->id > 0){
?>
if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}else{
?>
var username = form.username;
var password = form.password;
var password2 = form.password2;
if(name.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_NAME')?>");
name.focus();
return false;
}else if((username.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_UNAME')?>");
username.focus();
return false;
}else if((password.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_PWD')?>");
password.focus();
return false;
}else if((password2.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VPWD')?>");
password2.focus();
return false;
}else if((password.value != password2.value) && (userid == 0)){
alert("<?php echo JText::_('OS_PWDANDVPWDARETHESAME')?>");
password.focus();
return false;
}else if(email.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_EMAIL')?>");
email.focus();
return false;
}else if(! emailValid(email.value)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VALID_EMAIL')?>");
email.focus();
return false;
}else if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}
?>
}
and change to
function submitForm(){
var form = document.ftForm;
var name = form.name;
var email = form.email;
var address = form.address;
var userid = <?php echo intval($user->id)?>;
var captcha_agent_register = form.captcha_agent_register;
<?php
if($user->id > 0){
?>
if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(state.value == ""){
alert("<?php echo JText::_('Please select state')?>");
return false;
}else if(city.value == ""){
alert("<?php echo JText::_('Please select city')?>");
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}else{
?>
var username = form.username;
var password = form.password;
var password2 = form.password2;
if(name.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_NAME')?>");
name.focus();
return false;
}else if((username.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_UNAME')?>");
username.focus();
return false;
}else if((password.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_PWD')?>");
password.focus();
return false;
}else if((password2.value == "") && (userid == 0)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VPWD')?>");
password2.focus();
return false;
}else if((password.value != password2.value) && (userid == 0)){
alert("<?php echo JText::_('OS_PWDANDVPWDARETHESAME')?>");
password.focus();
return false;
}else if(email.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_EMAIL')?>");
email.focus();
return false;
}else if(! emailValid(email.value)){
alert("<?php echo JText::_('OS_PLEASE_ENTER_VALID_EMAIL')?>");
email.focus();
return false;
}else if(address.value == ""){
alert("<?php echo JText::_('OS_PLEASE_ENTER_ADDRESS')?>");
address.focus();
return false;
}else if(state.value == ""){
alert("<?php echo JText::_('Please select state')?>");
return false;
}else if(city.value == ""){
alert("<?php echo JText::_('Please select city')?>");
return false;
}else if(captcha_agent_register.value == 1){
var comment_security_code = form.comment_security_code;
var captcha_str = form.captcha_str;
if(comment_security_code.value != captcha_str.value){
alert(" <?php echo JText::_('OS_SECURITY_CODE_IS_WRONG')?>");
comment_security_code.focus();
}else{
form.submit();
}
}else{
form.submit();
}
<?php
}
?>
}
Thanks
Dam
Please Log in or Create an account to join the conversation.
Moderators: Dang Thuc Dam, Nguyen Phu Quan
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.