Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Retrieving selected value of drop down on page save...

  1. #1
    Shripad1988 is offline Sugar Community Member
    Join Date
    Jan 2012
    Location
    Pune
    Posts
    65

    Default Retrieving selected value of drop down on page save...

    Hello All,
    I have 2 drop downs 1 country created from studio and other state whose values i fetch from database.Now i have displayed state drop down based on country id from country drop down.Now when i click on save in edit view and again go to edit view my country selected value remains but state selected value doesnot remain..What must be wrong?
    I'm attaching my files plz go through it and revert soon...
    Attached Files Attached Files

  2. #2
    SagarCRM's Avatar
    SagarCRM is offline Sugar Community Member
    Join Date
    Oct 2011
    Location
    Mumbai, Maharashtra, India
    Posts
    111

    Default Re: Retrieving selected value of drop down on page save...

    Hi Shripad,
    I saw your both the files...
    my first question is your state values are statically filled or dynamically????

    like wise if its filled by you i have great solution for you

    If your country dropdown contains
    1)India
    2)Aus
    3)US

    And Other dropdown contains States, Which is filled from studio having all values as states of all this three countries
    we can simply filter is using upgrade proof javascript
    --

    Thanks & Regards,

    Sagar Salunkhe
    Mumbai, Maharashtra, INDIA

    sagar.salunkhe1991@gmail.com

    ~~ IT professionals never dies, they just go Offline... ~~


    sugar development and support services:- indian.sugarbean@gmail.com

  3. #3
    Shripad1988 is offline Sugar Community Member
    Join Date
    Jan 2012
    Location
    Pune
    Posts
    65

    Default Re: Retrieving selected value of drop down on page save...

    hi Sagar,
    My state list values are static..I'm fetching those values from table which conatins staes values for all 3 countries.I select state values from that table by comparing the id i send from drop down of country with a field named 'cname' in table which contains names same as id of country drop down...
    And yeah u mentioned about " we can simply filter is using upgrade proof javascript ".How can we do that?


    Thnxs Regards,
    Shripad

  4. #4
    Shripad1988 is offline Sugar Community Member
    Join Date
    Jan 2012
    Location
    Pune
    Posts
    65

    Default Re: Retrieving selected value of drop down on page save...

    Hi Sagar,
    Wat happened dude....Wats the answer.....How to use upgrade safe javascript method?

  5. #5
    SagarCRM's Avatar
    SagarCRM is offline Sugar Community Member
    Join Date
    Oct 2011
    Location
    Mumbai, Maharashtra, India
    Posts
    111

    Default Re: Retrieving selected value of drop down on page save...

    Hi Shripad,

    write this code on change event of states dropdown onchange

    Code:
    var states_c = document.getElementById('states_c');
    var countries_c = document.getElementById('countries_c');
    
    
    
    for(var i = states_c.options.length-1; i >= 0; i--)
    {
    if(states_c.value=='India')
    {
    	if((countries_c.options[i].value).indexOf("india") != -1)
    	{
    	states_c.remove(i);
    	}
    }
    }
    note: make sure that whenever you are adding states in states dropdown append suffix as country name in small... i.e. india_maharahtra and Display member as Maharashtra...

    ATA JAR NAHI AAL TAR BAGH...MI KAHICH SANGNAR NAHI YAPEKSHA JAST... :x
    --

    Thanks & Regards,

    Sagar Salunkhe
    Mumbai, Maharashtra, INDIA

    sagar.salunkhe1991@gmail.com

    ~~ IT professionals never dies, they just go Offline... ~~


    sugar development and support services:- indian.sugarbean@gmail.com

  6. #6
    Shripad1988 is offline Sugar Community Member
    Join Date
    Jan 2012
    Location
    Pune
    Posts
    65

    Default Re: Retrieving selected value of drop down on page save...

    Hi Sagar,
    Its not working yet dude?Everthing is working only i want to show my selected state value from list when i click on edit after saving on edit view?My country and state list is from studio.When i first enter edit view both show default.But wen i click on particular country its corressponding state list changes.When i select state and save and again click on edit on view edit view my state list shows default value instead of the 1 i.e selected?

  7. #7
    SagarCRM's Avatar
    SagarCRM is offline Sugar Community Member
    Join Date
    Oct 2011
    Location
    Mumbai, Maharashtra, India
    Posts
    111

    Default Re: Retrieving selected value of drop down on page save...

    Hi Shripad,
    your currently issue is you are saving the value which is not present in dropdown list...
    --

    Thanks & Regards,

    Sagar Salunkhe
    Mumbai, Maharashtra, INDIA

    sagar.salunkhe1991@gmail.com

    ~~ IT professionals never dies, they just go Offline... ~~


    sugar development and support services:- indian.sugarbean@gmail.com

  8. #8
    Shripad1988 is offline Sugar Community Member
    Join Date
    Jan 2012
    Location
    Pune
    Posts
    65

    Default Re: Retrieving selected value of drop down on page save...

    Hi Sagar,
    So shall i write the id in state table same as id i wrote in studio?

  9. #9
    SagarCRM's Avatar
    SagarCRM is offline Sugar Community Member
    Join Date
    Oct 2011
    Location
    Mumbai, Maharashtra, India
    Posts
    111

    Default Re: Retrieving selected value of drop down on page save...

    Quote Originally Posted by Shripad1988 View Post
    Hi Sagar,
    So shall i write the id in state table same as id i wrote in studio?
    yupzzzzzz..perfectly..the value member
    --

    Thanks & Regards,

    Sagar Salunkhe
    Mumbai, Maharashtra, INDIA

    sagar.salunkhe1991@gmail.com

    ~~ IT professionals never dies, they just go Offline... ~~


    sugar development and support services:- indian.sugarbean@gmail.com

  10. #10
    Shripad1988 is offline Sugar Community Member
    Join Date
    Jan 2012
    Location
    Pune
    Posts
    65

    Default Re: Retrieving selected value of drop down on page save...

    Hi Sagar,
    I'm attaching my screen shots before selecting any country,then after selecting country how my state drop down shows and then 3rd showing after SAVE how my edit view shows...PLz go through
    Attached Images Attached Images    

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 2009-12-17, 07:40 PM
  2. Drop downs - Unable to save data
    By sasben in forum Help
    Replies: 7
    Last Post: 2009-07-16, 07:18 PM
  3. Retrieving the list of all the drop downs lists
    By Liior in forum Developer Help
    Replies: 3
    Last Post: 2009-05-25, 09:59 AM
  4. Drop Downs with Selected Values
    By CSeDev in forum Developer Help
    Replies: 2
    Last Post: 2008-05-31, 06:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •