Refresh Page

Discussion in 'JavaScript' started by lost, Oct 18, 2005.

  1. #1
    I have a page with textfields and combo boxes. I would like to refresh the page when I select the "NEW" pushbutton.
     
    lost, Oct 18, 2005 IP
  2. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you want to try this?

    <form>
    <div align="center">
    <input type="button" onClick="history.go(0)" value="New">
    </div>
    </form>
    Code (markup):
     
    daboss, Oct 18, 2005 IP
  3. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #3
    could ya make the push button just link to that page so it reloads it?
     
    just-4-teens, Oct 18, 2005 IP
  4. Dread

    Dread Peon

    Messages:
    323
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #4
    care to elaborate slightly? im not sure what you mean.

    but just a submit form would refresh a page:
    
    <form action="page.htm" method="post">
    <input type="submit" value="refresh page" />
    </form>
    
    Code (markup):
    change page.htm to whatever your page is called, method could be post or get it doesnt matter unless you have other factors that require it to be one or the other.

    Do you requre the form to just clear itself? if so then just use a reset button
    
    <input type="reset" value="Reset Form" />
    
    Code (markup):
    If im off base here please explain what you mean.
     
    Dread, Oct 18, 2005 IP
  5. lost

    lost Peon

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Dread,
    What I currently have is a form with some textfields needed for input. I also have a "Save" button (submit) and a "Cancel" button (reset). In addition to that i have a button that is for new forms "New Form", which when pressed will clear all fields and make certain textfields available/not available.

    I've made the "New Form" button a reset button, it seems to work, it clears out the fields. However, if i enter values in the textfields and then hit the "Save" (submit) button first, then the "New Form" (reset) button, it does not clear the entries.

    Any ideas??

    I hope i've made myself clear this time.
     
    lost, Oct 18, 2005 IP
  6. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #6
    What do you mean? When you hit "save" it reloads the same page and puts the same values back in all the fields?
     
    exam, Oct 19, 2005 IP
  7. Dread

    Dread Peon

    Messages:
    323
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #7
    ok i think i understand your situation, but im still confused on what your goal is.
     
    Dread, Oct 19, 2005 IP
  8. lost

    lost Peon

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Well what I want to do is make sure that no matter when i hit the "New Form' button, it will clear all the entries and get ready for a New form with blank fields.

    Make sense??
     
    lost, Oct 19, 2005 IP
  9. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yes, I understand that, but how can the fields be filled out after you hit save?
     
    exam, Oct 19, 2005 IP
  10. lost

    lost Peon

    Messages:
    144
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Sorry what I meant is that if i fill out the fields in the form, hit save, then hit new form, the fields that i had previously entered dont clear out.
     
    lost, Oct 19, 2005 IP
  11. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #11
    You've totally lost me. Normally when you submit a form it would go to another page (or the same one) where the data is collected and saved in a database, then it would go back to the original for but it would be blank. Are using JS or AJAX or something to save the data without actuall submitting the form?
     
    exam, Oct 19, 2005 IP