SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    Nottingham, UK
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pass multiple Javascript values in a form

    Hello,

    I am passing a Javascript value from 1 page to another (in lasso language) by using this function below. count is the value I'm passing.

    function submitValue(el) {
    var elm = document.getElementById(el);
    var val = count;
    elm.value = val;
    return true;
    }

    and then sending it in the form on to the next page like this -

    <form name="postform" id="postform" method="post" action="action.lasso" >
    <input type="hidden" name="param" id="param" value="" />
    <input type="submit" value="Submit - Pay by Credit Card" onclick="submitValue('param');" />

    I now want to send a second Javascript value (count2) in the same form.
    How can I do this? Do I need to set up another function or include it in the same function. And then how do I reference and send the second value in the form?

    Thank you for any help

    Lagoona

  2. #2
    SitePoint Member
    Join Date
    May 2007
    Location
    San Francisco, California
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could send it in a serialized object.
    Ala utilizing the Data Transfer Object design pattern with a little JSON glue on both ends

    Google should explain JSON and DTO's


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
  •