SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: refresh page

  1. #1
    SitePoint Addict ghostme's Avatar
    Join Date
    Feb 2005
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    refresh page

    Hello good pple of the forum i ve 10 radio buttons in a form the first five have the same group name while the other does too.At the end of the form is a button that will give the score or point based on the option that the user would 've clicked, when the user clicks this button, an alert box appears that will that tell the user he/her score, after clicking on the "OK" button on the alert i want a situation in which the page would be refresh and the previous clicked options would automatically be erased.

  2. #2
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi ghostme,

    If you want to achieve it from java script then i'll not suggest you to do that. please use server side scripting like php, jsp, asp etc.

    But if at all you want to use java script then i can tell you the points about code. i'll try to put it after waords.
    1) for the first time show all the radio buttons.
    2) onclick of that display the score
    3) here comes tricky part. get the address of the current page using window.location.search then you need to append the value of the current radio button at the end and then say location.href (i.e. redirect to same page with the value of the current radio button)
    4) now when u come in the page check if the query string has any parameter then hide that particular radio button. (actually this will be the step at the first).
    5) for the step 3 actually u will be appending the value of the current radio button clicked. and keep on forwardiong.

    this way u can do it but this is real pain in *** think about it.
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.


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
  •