⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

set a value of dropdown



abhishek

abhishek
  • profile picture
  • Member

Posted 06 May 2013 - 12:19 PM

I am geting an id from the url and that id is value of an option in dropdown.

 

Ex:-<option value="37">xxx</option>

 

Now i want when the value is set , the dropdown value should be set to XXX.

 

 

Is there any way to pass value in set relation or any other way to do so..??


davidoster

davidoster
  • profile picture
  • Member

Posted 07 May 2013 - 09:00 AM

Well unfortunately it's not as easy task, as one might think, because it involves changes via javascript.

One way is to investigate this library: /index.php?app=core&module=attach&section=attach&attach_id=378

and the function get_js() [line 168].

This might give you a clue how you change the values of the dropdowns.

 

The other way is to have a model (or any function) that holds the data of the dropdown and then via an ajax call you change the contents of the dropdown. But this also will end up using some of the code that I pointed on the previous one.