Author Topic: [SOLVED]: Getting select boxes in SOBI2 - A bit more detailed walkthrough  (Read 30353 times)

0 Members and 1 Guest are viewing this topic.

Offline ashwin

First of all, SOBI is a great component and I have due respect and thanks for the developers.

Here it is-----------

Have been able to incorporte select boxes in SOBI using a very laughable trick-

I'm currently posting the url over here, so please try out the site and see if it is what you want.
http://kobol.sslcatacombnetworking.com/~emcentre/tenantreg
Login with the following credentials
Username: demo
Password: demo1234

Once logged in, click on the 'Add Tenant' link, and there you are.

I'm in a bit of a hurry now, as I am leaving town for the weekend.

I leave it to all of you to figure out what the trick is. In any case i'll post the procedure on Monday, when i'm back.
« Last Edit: 18. August 2008, 09:13:29 by Trinity »
If wishes were horses, i'd own a a stud farm..

Joomla development, Custom PHP/MySQL
www.tekdi.net
Country: India India |  View Profile Tekdi Web Services


Offline ashwin

Re: Orthodox method of getting select boxes in SOBI2
« Reply #1 on: 02. December 2006, 12:53:05 »
I'm sorry there was a problem accessing the site using the password supplied. I have rectified the changes.

You can now see the site. Ill post the procedure in a day.
If wishes were horses, i'd own a a stud farm..

Joomla development, Custom PHP/MySQL
www.tekdi.net
Country: India India |  View Profile Tekdi Web Services

Do you want continued ongoing development, new features and active support?
Please write a review or just vote for SOBI on JED.

Offline garyedwardjohnston

Re: Getting select boxes in SOBI2
« Reply #2 on: 04. December 2006, 01:04:22 »
You are mean! lol

I think it is great that you figured out how to do this.

I for 1 would love the answer, so pleeeeeeeeease let me know.

Thanks,
Gary
garyedwardjohnston@yahoo.ca
Country: United States United States |  View Profile

Offline ashwin

Re: Getting select boxes in SOBI2
« Reply #3 on: 04. December 2006, 09:17:54 »
Step 1: hide the inputbox for the required field by eneting the following in the css
#field_fieldname {
display: none;
}

Step 2:
Now, in an independent html file create the select box u want. ALso create the following JS code
function field_copy()
{
document.sobi2EditForm.field_fieldname.value=document.test.select.value;
}

U will need to put the selectbox in a div and position it so that it takes the position of the original inputbox.
In the params for the selectbox, add the following onblur="field_copy()"

Step 3: find this in sobi.php
echo $addForm->showForm();

Ad the html code from the above created file here and save.

Step 4: And we're done


Ok, this might sound a little complicated, but if you know a little bit of JS and php, u'll get an idea of what i mean.


In any case, u can mail me on coolbung@gmail.com. I might be able to help you.

Regards,
Ashwin


If wishes were horses, i'd own a a stud farm..

Joomla development, Custom PHP/MySQL
www.tekdi.net
Country: India India |  View Profile Tekdi Web Services

Offline bijlmer

Re: Getting select boxes in SOBI2
« Reply #4 on: 04. December 2006, 16:23:14 »
Hi,
yes it looks good.

Different question, i saw your search tennant thing, is this also een Sobi thing, how did you do that, i need something like that too.

thanks.
Hans
Country: Netherlands Netherlands |  View Profile

Offline garyedwardjohnston

Re: Getting select boxes in SOBI2
« Reply #5 on: 05. December 2006, 01:34:42 »
Step 1: hide the inputbox for the required field by eneting the following in the css
#field_fieldname {
display: none;
}

Step 2:
Now, in an independent html file create the select box u want. ALso create the following JS code
function field_copy()
{
document.sobi2EditForm.field_fieldname.value=document.test.select.value;
}

U will need to put the selectbox in a div and position it so that it takes the position of the original inputbox.
In the params for the selectbox, add the following onblur="field_copy()"

Step 3: find this in sobi.php
echo $addForm->showForm();

Ad the html code from the above created file here and save.

Step 4: And we're done


Ok, this might sound a little complicated, but if you know a little bit of JS and php, u'll get an idea of what i mean.


In any case, u can mail me on coolbung@gmail.com. I might be able to help you.

Regards,
Ashwin




Wow, not only have u figured this out, but have provided a solution.  Great!

Only one problem, I want to get this done but am a newb and need detailed instruction.  I would try following your plan, but there are spots in you description where you assume I or others know what to do.

I would be forever greatful if you provided a walkthrough.  I think the country field might make a good example for the masses.

Thanks,
Gary

PS I've found a list of them all to help you:

  • Afghanistan,af
    Aland Islands,ax
    Albania,al
    Algeria,dz
    American Samoa,as
    Andorra,ad
    Angola,ao
    Anguilla,ai
    Antarctica,aq
    Antigua and Barbuda,ag
    Argentina,ar
    Armenia,am
    Aruba,aw
    Ascension Island,ac
    Australia,au
    Austria,at
    Azerbaijan,az
    Bahamas,bs
    Bahrain,bh
    Bangladesh,bd
    Barbados,bb
    Belarus,by
    Belgium,be
    Belize,bz
    Benin,bj
    Bermuda,bm
    Bhutan,bt
    Bolivia,bo
    Bosnia and Herzegovina,ba
    Botswana,bw
    Bouvet Island,bv
    Brazil,br
    British Indian Ocean Territory,io
    Brunei Darussalam,bn
    Bulgaria,bg
    Burkina Faso,bf
    Burundi,bi
    Cambodia,kh
    Cameroon,cm
    Canada,ca
    Cape Verde,cv
    Cayman Islands,ky
    Central African Republic,cf
    Chad,td
    Chile,cl
    China,cn
    Christmas Island,cx
    Cocos (Keeling) Islands,cc
    Colombia,co
    Comoros,km
    Republic of Congo,cg
    Democratic Republic of Congo,cd
    Cook Islands,ck
    Costa Rica,cr
    Cote d'Ivoire,ci
    Croatia/Hrvatska,hr
    Cuba,cu
    Cyprus,cy
    Czech Republic,cz
    Denmark,dk
    Djibouti,dj
    Dominica,dm
    Dominican Republic,do
    East Timor,tp
    Ecuador,ec
    Egypt,eg
    El Salvador,sv
    Equatorial Guinea,gq
    Eritrea,er
    Estonia,ee
    Ethiopia,et
    European Union,eu
    Falkland Islands (Malvinas),fk
    Faroe Islands,fo
    Fiji,fj
    Finland,fi
    France,fr
    French Guiana,gf
    French Polynesia,pf
    French Southern Territories,tf
    Gabon,ga
    Gambia,gm
    Georgia,ge
    Germany,de
    Ghana,gh
    Gibraltar,gi
    Greece,gr
    Greenland,gl
    Grenada,gd
    Guadeloupe,gp
    Guam,gu
    Guatemala,gt
    Guernsey,gg
    Guinea,gn
    Guinea-Bissau,gw
    Guyana,gy
    Haiti,ht
    Heard and McDonald Islands,hm
    Holy See (Vatican City State),va
    Honduras,hn
    Hong Kong,hk
    Hungary,hu
    Iceland,is
    India,in
    Indonesia,id
    "Iran, Islamic Republic of",ir
    Iraq,iq
    Ireland,ie
    Isle of Man,im
    Israel,il
    Italy,it
    Jamaica,jm
    Japan,jp
    Jersey,je
    Jordan,jo
    Kazakhstan,kz
    Kenya,ke
    Kiribati,ki
    "Korea, Democratic People's Republic",kp
    "Korea, Republic of",kr
    Kuwait,kw
    Kyrgyzstan,kg
    Lao People's Democratic Republic,la
    Latvia,lv
    Lebanon,lb
    Lesotho,ls
    Liberia,lr
    Libyan Arab Jamahiriya,ly
    Liechtenstein,li
    Lithuania,lt
    Luxembourg,lu
    Macao,mo
    "Macedonia, The Former Yugoslav Republic of",mk
    Madagascar,mg
    Malawi,mw
    Malaysia,my
    Maldives,mv
    Mali,ml
    Malta,mt
    Marshall Islands,mh
    Martinique,mq
    Mauritania,mr
    Mauritius,mu
    Mayotte,yt
    Mexico,mx
    "Micronesia, Federated States of",fm
    "Moldova, Republic of",md
    Monaco,mc
    Mongolia,mn
    Montenegro,me
    Montserrat,ms
    Morocco,ma
    Mozambique,mz
    Myanmar,mm
    Namibia,na
    Nauru,nr
    Nepal,np
    Netherlands,nl
    Netherlands Antilles,an
    New Caledonia,nc
    New Zealand,nz
    Nicaragua,ni
    Niger,ne
    Nigeria,ng
    Niue,nu
    Norfolk Island,nf
    Northern Mariana Islands,mp
    Norway,no
    Oman,om
    Pakistan,pk
    Palau,pw
    "Palestinian Territory, Occupied",ps
    Panama,pa
    Papua New Guinea,pg
    Paraguay,py
    Peru,pe
    Philippines,ph
    Pitcairn Island,pn
    Poland,pl
    Portugal,pt
    Puerto Rico,pr
    Qatar,qa
    Reunion Island,re
    Romania,ro
    Russian Federation,ru
    Rwanda,rw
    Saint Helena,sh
    Saint Kitts and Nevis,kn
    Saint Lucia,lc
    Saint Pierre and Miquelon,pm
    Saint Vincent and the Grenadines,vc
    Samoa,ws
    San Marino,sm
    Sao Tome and Principe,st
    Saudi Arabia,sa
    Senegal,sn
    Serbia,rs
    Seychelles,sc
    Sierra Leone,sl
    Singapore,sg
    Slovak Republic,sk
    Slovenia,si
    Solomon Islands,sb
    Somalia,so
    South Africa,za
    South Georgia and the South Sandwich Islands,gs
    Soviet Union (being phased out),su
    Spain,es
    Sri Lanka,lk
    Sudan,sd
    Suriname,sr
    Svalbard and Jan Mayen Islands,sj
    Swaziland,sz
    Sweden,se
    Switzerland,ch
    Syrian Arab Republic,sy
    Taiwan,tw
    Tajikistan,tj
    Tanzania,tz
    Thailand,th
    Timor-Leste,tl
    Togo,tg
    Tokelau,tk
    Tonga,to
    Trinidad and Tobago,tt
    Tunisia,tn
    Turkey,tr
    Turkmenistan,tm
    Turks and Caicos Islands,tc
    Tuvalu,tv
    Uganda,ug
    Ukraine,ua
    United Arab Emirates,ae
    United Kingdom,gb
    United Kingdom,uk
    United States,us
    United States Minor Outlying Islands,um
    Uruguay,uy
    Uzbekistan,uz
    Vanuatu,vu
    Venezuela,ve
    Vietnam,vn
    "Virgin Islands, British",vg
    "Virgin Islands, U.S.",vi
    Wallis and Futuna Islands,wf
    Western Sahara,eh
    Yemen,ye
    Yugoslavia,yu
    Zambia,zm
    Zimbabwe,zw
Country: United States United States |  View Profile

Offline ckayfish

  • Sponsor
  • Sobi User
  • *
  • Posts: 67
  • Your mind makes it real
  • Reviews:

    What is it?

Re: Getting select boxes in SOBI2
« Reply #6 on: 05. December 2006, 20:32:34 »
Hi Garyedwardjohnston

What ashwin as found a work-around for is checkboxes. I think you you are looking for is a dropdown list. These are very different.

Curtis
Discover Nunavut at NunavutOnline.com
Country: Canada Canada |  View Profile NunavutOnline.Com

Offline Eihwaz

Re: Getting select boxes in SOBI2
« Reply #7 on: 05. December 2006, 21:21:09 »
Curtis, those are acutally dropdown lists :)
Although I couldn't get it to work too, just got to the part where you display the dropdown box in the form, but I can't make it to accept values user have chosen...
- Tell me, please, how to check, if table exists in MySQL database?
- If (mysql_query('DROP TABLE your_table')) echo "table existed";
Country: Ukraine Ukraine |  View Profile

Offline ashwin

Re: Getting select boxes in SOBI2
« Reply #8 on: 06. December 2006, 10:11:49 »
Hello,

This is a workaround for getting select boxes using some smart Javascript.

It's a pretty simple procedure. U will be able to use the one given above if you are able to use PHP & JavaScript.
In any case you can contact me on coolbung@gmail.com. I'll be able to help you.
If wishes were horses, i'd own a a stud farm..

Joomla development, Custom PHP/MySQL
www.tekdi.net
Country: India India |  View Profile Tekdi Web Services

Offline ckayfish

  • Sponsor
  • Sobi User
  • *
  • Posts: 67
  • Your mind makes it real
  • Reviews:

    What is it?

Re: Getting select boxes in SOBI2
« Reply #9 on: 06. December 2006, 15:25:18 »
Curtis, those are acutally dropdown lists :)
Although I couldn't get it to work too, just got to the part where you display the dropdown box in the form, but I can't make it to accept values user have chosen...

OK, I got to stop posting when Im so tired :) I was focusing in the select boxes for rating the tenants and honestly didn't see what the big deal was since SOBI2 supports them natively. I mistakenly thought there may have been some logic to prevent rating a tenant as bad, if the last box specifying they are 'good' is selected. I didnt even notice the Date/rental areas drop-down lists!

Good job ashwin!
Discover Nunavut at NunavutOnline.com
Country: Canada Canada |  View Profile NunavutOnline.Com

Tags: