Welcome, Guest
Username Password: Remember me

Select Field (2 field linked)
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Select Field (2 field linked)

Select Field (2 field linked) 1 year, 5 months ago #1

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
H People,

i am looking at this thread.

It doesnt suit me as my selection is not base on any j! db.

How do i select first one and second option provided automatically.
Let's discuss.

I beleive there is a need to use Javascript.

thanks.

Re: Select Field (2 field linked) 1 year, 5 months ago #2

  • key2starz
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 1
Hi Jay,

What is your selection based on then? You could always put that into a table and then use the Database>Simple Query field type.

Best of luck.
Thanks so much, I really appreciate you taking the time to read my post.

Re: Select Field (2 field linked) 1 year, 5 months ago #3

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
key2starz wrote:
Hi Jay,

What is your selection based on then? You could always put that into a table and then use the Database>Simple Query field type.

Best of luck.


Hi,thanks. the selection example

Toyota - Camry
- Corolla
- Alphard

BMW -7 series
-6 series
-5 series
-3 series

i am not sure what u mean by put into table, u mean db table?

thanks

Re: Select Field (2 field linked) 1 year, 5 months ago #4

  • key2starz
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 1
Hi,

Use your favorite DB admin program like phpMyAdmin to create a table or two to hold your make/model information.

From there, you can use the Select>Dynamic Field type to filter these like you want.

Regarding the setup of your tables, there are a few ways to do this -- and it is more a SQL database question than a jSeblod question.

Best,
Thanks so much, I really appreciate you taking the time to read my post.
Last Edit: 1 year, 5 months ago by key2starz.

Re: Select Field (2 field linked) 1 year, 5 months ago #5

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
key2starz wrote:
Hi,

Use your favorite DB admin program like phpMyAdmin to create a table or two to hold your make/model information.

From there, you can use the Select>Dynamic Field type to filter these like you want.

Regarding the setup of your tables, there are a few ways to do this -- and it is more a SQL database question than a jSeblod question.

Best,


Hi.

I am aware of this possibilities.
What i am looking for is a solution without need to create db tables.
can u imagine creating table just for this. its not efficient in my opinion.

my suggestion is to use onchange="" event to detect and display.

thanks
Last Edit: 1 year, 5 months ago by Jay.

Re: Select Field (2 field linked) 1 year, 5 months ago #6

  • key2starz
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 1
Hi,

I'll leave the commenting to others, then. Unless you only have Toyota/BMW and those 2 makes and 9 models, a table seems like the perfect place to keep your data.

Best,
Thanks so much, I really appreciate you taking the time to read my post.

Re: Select Field (2 field linked) 1 year, 5 months ago #7

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
Its possible to do if there is a field allowed to add additional attributes (for onchange var) and scripts.

Re: Select Field (2 field linked) 1 year, 4 months ago #8

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
Hi guys,

i research n came out with below.
Lets test how to integrate and get them working.


Additional attributes: onchange="dynamic(this,'your_ABCfield');"


<script type="text/javascript">
function dynamic(parent,child)
{
var parent_array = new Array();
// This is the default value
parent_array[''] = ['Please select your Opiton1'];
// All other elements
// parent_array['PARENT NAME'] = ['CHILD 1','CHILD 2','CHILD 3','ETC'];
parent_array['A'] = ['A1','A2','Studio','A3','A4','A5'];
parent_array['B'] = ['B1','B2','B3','B4','B5'];
parent_array['C'] = ['C1','C2','C3','C4','C5'];
parent_array['D'] = ['D1','D2','D3','D4','D5'];
parent_array['E'] = ['E1'];


// Get the child
var thechild = document.getElementById(child);

// Remove all other options from the select element
thechild.options.length = 0;

// What value are we looking for ?
var parent_value = parent.options[parent.selectedIndex].value;

// No value found, use the default value
if (!parent_array[parent_value]) parent_value = '';

// Set the correct length
thechild.options.length = parent_array[parent_value].length;

// Add the options
for(var i=0;i<parent_array[parent_value].length;i++)
{
thechild.options[i].text = parent_array[parent_value][i];
thechild.options[i].value = parent_array[parent_value][i];
}
}
</script>

THANKS

Re: Select Field (2 field linked) 1 year, 4 months ago #9

  • key2starz
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 1
You can check out this post.

Hopefully something cool will be coming soon.
Thanks so much, I really appreciate you taking the time to read my post.

Re: Select Field (2 field linked) 1 year, 4 months ago #10

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
HI, Lets hope something is coming up

meanwhile , any temporary solutions?

Re: Select Field (2 field linked) 1 year, 4 months ago #11

  • SEBLOD - Bes
  • ( Admin )
  • OFFLINE
  • Administrator
  • Working on SEBLOD 2.0 GA
  • Posts: 3141
  • Karma: 97
Hi,

But drupal module use some AJAX features like jSeblod CCK select dynamic field. It's a other problem to do this whitout AJAX, you are limited by the number of options.

@Jay, you can try exactly your script with jSeblod CCK field by writing "at the hand" the input form (see HTML code source how a field is generated).

Best Regards
If you use SEBLOD CCK, please post a rating and a review at the Joomla! Extensions Directory. Thanks to you.!!"
SEBLOD Vimeo Channel: vimeo.com/channels/seblod
SHAPE YOUR SITE YOUR WAY
Last Edit: 1 year, 4 months ago by SEBLOD - Bes.

Re: Select Field (2 field linked) 1 year, 4 months ago #12

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
Hi Bes.

i m very confuse with all these jargons.

How do we achieve that?

thanks

Re: Select Field (2 field linked) 1 year, 4 months ago #13

  • key2starz
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 1
Hi Jay,

I think you could just write the code for it "by hand". You can generate a custom template and then take a look at the index.html file code (and see what PHP code the templates use to create the HTML the user sees). In ohter words, you can still use jSeblod to house the custom data (and display it, etc), but you'll need to write your own code for the form that allows for user input.

I know that the learning curve for jSeblod is a bit steep - I am a hobbyist PHP coder and it took a while to see how calls are made and variables accessed/set with jSeblod (in fact, I'm still only partially able to understand all the functions).

If you are not familiar with PHP or HTML coding, then I'd say jSeblod may not be the best way to achieve what you are after at the moment.

If you need some help understanding templates, PM me and I'll send a tutorial I'm working on - it is mostly done and walks you step-by-step through the creation process. By the end, templates should make a lot more sense.

Best,
Thanks so much, I really appreciate you taking the time to read my post.
Last Edit: 1 year, 4 months ago by key2starz.

Re: Select Field (2 field linked) 1 year, 4 months ago #14

  • Jay
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 74
  • Karma: 0
Hi Key,

i m using custom template.
Have achieve most of the thing that i need so far.

Have even used some custom script as well.
I am a hobbyist PHP coder as well, still learning PHP tough.

in fact, this little rascal hook me to study PHP for the first time. .

Enjoying every moment coding this template.

Oh. Yes. please send me.

cheers. thanks
  • Page:
  • 1
Time to create page: 0.31 seconds