SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot ricklach's Avatar
    Join Date
    Nov 2004
    Location
    Victoria BC
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with button_to_function

    From a popup I am trying to pass back values to the parent. I have the following bit of code in a view rhtml file:
    Code:
     <script language="javascript">
    
        function setVars(vid, particulars) {
      		if (window.opener) {
        		window.opener.document.getElementById('eda_officers_voter_id').value = vid; 
        		window.opener.document.getElementById('eda_officers_particulars').value = particulars;
        		self.close();
      		}
    	}
    </script>
    and this bit of code that fills in the form
    Code:
    <%= button_to_function 'Pick Me',  onClick="setVars(list_stripes.vid ,'list_stripes.firstname list_stripes.lastname, list_stripes.residence.number list_stripes.residence.precompass list_stripes.residence.streetname list_stripes.residence.streettype list_stripes.residence.postcompass, list_stripes.residence.city list_stripes.residence.postalcode')"  %>
    The problem is the syntax after the onclick event. I can't seem to get the values to appear for the "list_stripes" variables - I have tried several concatination schemes without success. Is there an easy way to do this?
    Ruby, Ruby when will you be mine

  2. #2
    SitePoint Zealot ricklach's Avatar
    Join Date
    Nov 2004
    Location
    Victoria BC
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found the solution. No need to answer.
    Ruby, Ruby when will you be mine


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
  •