SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    passing values in a form

    The problem:
    I am trying to pass values from a textarea to an input box or vice-versa....
    I am using a function to do this with the onClick method in my submit button.

    The value is being passed but only for a second and then vanishes.

    Any advice on this?

    the source can be found here:
    www.meztec.com/test/popup.html

  2. #2
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't know javascript so i'm not sure about the client side solution, but i could do that really easy in a server side language such as ASP.

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Meztec, since you are using javascript, a client-side technology, once the form is submitted the values of the text fields and text reas will go back to their original blank values. Becuase you use an onClick handler in your submit button, the values get changed till the form is submitted, which happens a second after the values are changed, try making the submit button a regular button. like <input type="button" if you need to preserve the values after the form is submitted you will need a server side technology as lucas mentioned.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    changing to "button" I think will work for what I want...

    my current code is backwards for testing purposes..but my goal is for the user to put in values in the fields then generate code in the textarea...that code can then be pasted into an html document.

    More of a cut-paste js solution instead of server side solution. Would also like to try the server side solution in the future...probably w/ php.


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
  •