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.

Requery/Refresh Form Control

corydeppencorydeppen Posts: 3Member
I have a form in an ASP page that contains a drop down list with a button that opens another page if the user wants to add another entry to the list. Once the user adds a new entry and returns to the original form, the newly added item doesn't appear in the list.

I was hoping someone knew of a way, via JavaScript or ASP, to refresh or requery the drop down list control () so the new item appears in the list.

Thanks,
Cory

Comments

  • GideonOmegaGideonOmega Posts: 617Member
    : I have a form in an ASP page that contains a drop down list with a button that opens another page if the user wants to add another entry to the list. Once the user adds a new entry and returns to the original form, the newly added item doesn't appear in the list.
    :
    : I was hoping someone knew of a way, via JavaScript or ASP, to refresh or requery the drop down list control () so the new item appears in the list.
    :
    : Thanks,
    : Cory
    :
    :

    I'm guessing your drop down list is loaded through ASP? if so I'm also assuming that you are loading the data from a file or database and adding there entry as well? If that is the case then you can simply reload the page with JS or VBScript as in....... onClick="functiontoupdateDB;javascript:window.location='myASPPage.asp'"


    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • corydeppencorydeppen Posts: 3Member
    : : I have a form in an ASP page that contains a drop down list with a button that opens another page if the user wants to add another entry to the list. Once the user adds a new entry and returns to the original form, the newly added item doesn't appear in the list.
    : :
    : : I was hoping someone knew of a way, via JavaScript or ASP, to refresh or requery the drop down list control () so the new item appears in the list.
    : :
    : : Thanks,
    : : Cory
    : :
    : :
    :
    : I'm guessing your drop down list is loaded through ASP? if so I'm also assuming that you are loading the data from a file or database and adding there entry as well? If that is the case then you can simply reload the page with JS or VBScript as in....... onClick="functiontoupdateDB;javascript:window.location='myASPPage.asp'"
    :
    :
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    Thanks for the reply. I was considering refreshing the page, but that would require the user to re-enter all of the data they've already input. Can you think of a way to refresh just the single control without refreshing the entire page?

    Thanks,
    Cory

  • GideonOmegaGideonOmega Posts: 617Member
    : : : I have a form in an ASP page that contains a drop down list with a button that opens another page if the user wants to add another entry to the list. Once the user adds a new entry and returns to the original form, the newly added item doesn't appear in the list.
    : : :
    : : : I was hoping someone knew of a way, via JavaScript or ASP, to refresh or requery the drop down list control () so the new item appears in the list.
    : : :
    : : : Thanks,
    : : : Cory
    : : :
    : : :
    : :
    : : I'm guessing your drop down list is loaded through ASP? if so I'm also assuming that you are loading the data from a file or database and adding there entry as well? If that is the case then you can simply reload the page with JS or VBScript as in....... onClick="functiontoupdateDB;javascript:window.location='myASPPage.asp'"
    : :
    : :
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : Thanks for the reply. I was considering refreshing the page, but that would require the user to re-enter all of the data they've already input. Can you think of a way to refresh just the single control without refreshing the entire page?
    :
    : Thanks,
    : Cory
    :
    :

    Sorry, I'm not sure how you could do that, but you could refresh the page by using a ASP query string, or cookies to pass the data back into the form on the refresh.

    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • corydeppencorydeppen Posts: 3Member
    : : : : I have a form in an ASP page that contains a drop down list with a button that opens another page if the user wants to add another entry to the list. Once the user adds a new entry and returns to the original form, the newly added item doesn't appear in the list.
    : : : :
    : : : : I was hoping someone knew of a way, via JavaScript or ASP, to refresh or requery the drop down list control () so the new item appears in the list.
    : : : :
    : : : : Thanks,
    : : : : Cory
    : : : :
    : : : :
    : : :
    : : : I'm guessing your drop down list is loaded through ASP? if so I'm also assuming that you are loading the data from a file or database and adding there entry as well? If that is the case then you can simply reload the page with JS or VBScript as in....... onClick="functiontoupdateDB;javascript:window.location='myASPPage.asp'"
    : : :
    : : :
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : :
    : : Thanks for the reply. I was considering refreshing the page, but that would require the user to re-enter all of the data they've already input. Can you think of a way to refresh just the single control without refreshing the entire page?
    : :
    : : Thanks,
    : : Cory
    : :
    : :
    :
    : Sorry, I'm not sure how you could do that, but you could refresh the page by using a ASP query string, or cookies to pass the data back into the form on the refresh.
    :
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    How would you refresh the page via ASP?

  • GideonOmegaGideonOmega Posts: 617Member
    : : : : : I have a form in an ASP page that contains a drop down list with a button that opens another page if the user wants to add another entry to the list. Once the user adds a new entry and returns to the original form, the newly added item doesn't appear in the list.
    : : : : :
    : : : : : I was hoping someone knew of a way, via JavaScript or ASP, to refresh or requery the drop down list control () so the new item appears in the list.
    : : : : :
    : : : : : Thanks,
    : : : : : Cory
    : : : : :
    : : : : :
    : : : :
    : : : : I'm guessing your drop down list is loaded through ASP? if so I'm also assuming that you are loading the data from a file or database and adding there entry as well? If that is the case then you can simply reload the page with JS or VBScript as in....... onClick="functiontoupdateDB;javascript:window.location='myASPPage.asp'"
    : : : :
    : : : :
    : : : : [blue]
    : : : : C:Dos
    : : : : C:Dos Run
    : : : : Run Dos Run
    : : : : [/blue]
    : : : :
    : : : :
    : : : Thanks for the reply. I was considering refreshing the page, but that would require the user to re-enter all of the data they've already input. Can you think of a way to refresh just the single control without refreshing the entire page?
    : : :
    : : : Thanks,
    : : : Cory
    : : :
    : : :
    : :
    : : Sorry, I'm not sure how you could do that, but you could refresh the page by using a ASP query string, or cookies to pass the data back into the form on the refresh.
    : :
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : How would you refresh the page via ASP?
    :
    :


    Sorry I should have been more clear, I don't mean to refresh the page with asp, you would have to use js or vbscript for that, but you could pass the values in a qrystring for example

    [code]
    ....
    '>



    function RefreshMe()
    {
    var Name = document.frmOne.txtName.value;
    window.location = "myASPPage.asp?Name=" + Name;
    }
    [/code]

    will refresh the page and automaticly set the value of the passed value into the text box, if it is blank then nothing will show up for the value.

    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

Sign In or Register to comment.