Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

double combo box problem

thegar1thegar1 Posts: 9Member
I have to make a double combo box and a button 'go'. First the user will select from the first, then he will select from the second, and then he will push the button, so a new page will be opened. But i want, when the user will push the 'back' button the drop down menus both to be in their default situation. Something like 'reset' the page. I have managed the drop menus working but when i press 'back' the page doesn't reset itself so the results are false. PLEASE HELP!!!

Comments

  • Secret_DoomSecret_Doom Posts: 116Member
    That's very easy to do:

    [code][/code]

    The commands on the OnLoad inside the BODY tag will be run every time the page is loaded.
    There is an another way, too:

    [code]




    var1='default_value';
    var2='default_value2';

    [/code]

    If the commands aren't inside a function, they will be also run once the page is loaded. But be careful: if you put such commands on the top of the page, they might not work, 'cause the combo boxes won't be there by now (they won't have been created, because the browser didn't reach that part of the HTML yet). By putting the commands on the end of the page, the combo boxes will certainly already been created.

    Is that what you wanted ? Where I clear enough?

    -- Secret_Doom - Leonardo Pignataro --

    secret_doom@hotmail.com
    www.batch.hpg.com.br


    : I have to make a double combo box and a button 'go'. First the user will select from the first, then he will select from the second, and then he will push the button, so a new page will be opened. But i want, when the user will push the 'back' button the drop down menus both to be in their default situation. Something like 'reset' the page. I have managed the drop menus working but when i press 'back' the page doesn't reset itself so the results are false. PLEASE HELP!!!
    :
  • thegar1thegar1 Posts: 9Member
    It doesn't work. Instead of 'default value' i type '0' or 0 or ''. Nothing. i put it in the end of the function, nothing.Here is the code:

                                                      




    var groups=document.doublecombo.example.options.length
    var group=new Array(groups)

    for (i=0; i0;m--)
    temp.options[m]=null
    for (i=0;i




    i would be very thankful if you could help me.


    : That's very easy to do:
    :
    : [code][/code]
    :
    : The commands on the OnLoad inside the BODY tag will be run every time the page is loaded.
    : There is an another way, too:
    :
    : [code]
    :
    :
    :
    :
    : var1='default_value';
    : var2='default_value2';
    :
    : [/code]
    :
    : If the commands aren't inside a function, they will be also run once the page is loaded. But be careful: if you put such commands on the top of the page, they might not work, 'cause the combo boxes won't be there by now (they won't have been created, because the browser didn't reach that part of the HTML yet). By putting the commands on the end of the page, the combo boxes will certainly already been created.
    :
    : Is that what you wanted ? Where I clear enough?
    :
    : -- Secret_Doom - Leonardo Pignataro --
    :
    : secret_doom@hotmail.com
    : www.batch.hpg.com.br
    :
    :
    : : I have to make a double combo box and a button 'go'. First the user will select from the first, then he will select from the second, and then he will push the button, so a new page will be opened. But i want, when the user will push the 'back' button the drop down menus both to be in their default situation. Something like 'reset' the page. I have managed the drop menus working but when i press 'back' the page doesn't reset itself so the results are false. PLEASE HELP!!!
    : :
    :

  • thegar1thegar1 Posts: 9Member
    The whole problem is about the Internet Explorer's button 'back', i think.







    : It doesn't work. Instead of 'default value' i type '0' or 0 or ''. Nothing. i put it in the end of the function, nothing.Here is the code:
    :
    :

                                                      
    :
    :
    :
    :

    :
    : var groups=document.doublecombo.example.options.length
    : var group=new Array(groups)
    :
    : for (i=0; i0;m--)
    : temp.options[m]=null
    : for (i=0;i
    :
    :
    :
    :
    : i would be very thankful if you could help me.
    :
    :
    : : That's very easy to do:
    : :
    : : [code][/code]
    : :
    : : The commands on the OnLoad inside the BODY tag will be run every time the page is loaded.
    : : There is an another way, too:
    : :
    : : [code]
    : :
    : :
    : :
    : :
    : : var1='default_value';
    : : var2='default_value2';
    : :
    : : [/code]
    : :
    : : If the commands aren't inside a function, they will be also run once the page is loaded. But be careful: if you put such commands on the top of the page, they might not work, 'cause the combo boxes won't be there by now (they won't have been created, because the browser didn't reach that part of the HTML yet). By putting the commands on the end of the page, the combo boxes will certainly already been created.
    : :
    : : Is that what you wanted ? Where I clear enough?
    : :
    : : -- Secret_Doom - Leonardo Pignataro --
    : :
    : : secret_doom@hotmail.com
    : : www.batch.hpg.com.br
    : :
    : :
    : : : I have to make a double combo box and a button 'go'. First the user will select from the first, then he will select from the second, and then he will push the button, so a new page will be opened. But i want, when the user will push the 'back' button the drop down menus both to be in their default situation. Something like 'reset' the page. I have managed the drop menus working but when i press 'back' the page doesn't reset itself so the results are false. PLEASE HELP!!!
    : : :
    : :
    :
    :

  • Secret_DoomSecret_Doom Posts: 116Member
    I don't know if you followed my suggestion correctly, so here goes it, applyed to your code (the var setting must be on the end of the script, OUTSIDE from a function)

    [code]







    var groups=document.doublecombo.example.options.length
    var group=new Array(groups)

    for (i=0; i0;m--)
    temp.options[m]=null
    for (i=0;i



    [/code]

    I see no reason why this shouldn't work.
    Please keep me informed.

    -- Secret_Doom - Leonardo Pignataro --

    secret_doom@hotmail.com
    www.batch.hpg.com.br

  • thegar1thegar1 Posts: 9Member
    Thank you very much, Secret Doom... i need lessons in Javascript.... thanks again!!!

    : I don't know if you followed my suggestion correctly, so here goes it, applyed to your code (the var setting must be on the end of the script, OUTSIDE from a function)
    :
    : [code]
    :
    :


    :
    :
    :
    :
    :

    :
    : var groups=document.doublecombo.example.options.length
    : var group=new Array(groups)
    :
    : for (i=0; i0;m--)
    : temp.options[m]=null
    : for (i=0;i
    :
    :
    :
    : [/code]
    :
    : I see no reason why this shouldn't work.
    : Please keep me informed.
    :
    : -- Secret_Doom - Leonardo Pignataro --
    :
    : secret_doom@hotmail.com
    : www.batch.hpg.com.br
    :
    :

Sign In or Register to comment.