By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,538 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

multiple variable 'onclick' event

ddtpmyra
100+
P: 333
How can I assigned multiple varialble from my result query?
example of my code is

Parent Form:
Expand|Select|Wrap|Line Numbers
  1.     <input type=\"text\" name=\"contactid\"  
  2.     if $contact !='NULL' 
  3.     then value=\"$contact\" 
  4.     else value=\"1\" onclick=\"window.open('contact_search.php')\"></input>";
child Form #1:
Expand|Select|Wrap|Line Numbers
  1. <form action="contact_search_sub.php" method="post" name="contact_search_sub">
child Form #2:
Expand|Select|Wrap|Line Numbers
  1.  echo "<td><input type='button' value='select' onclick=\"contactid('". $row['contactid']. "')\" >"; 
how can i assigned more than one query result back to my original page? For instance, the name and contact id?
Sep 8 '09 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
You could use window.opener to refer to the parent and then use something like:
Expand|Select|Wrap|Line Numbers
  1. window.opener.document.getElementById("contactid").value = contactid;
and likewise for any more results.
Sep 9 '09 #2

ddtpmyra
100+
P: 333
@acoder
what if i wanted contactname field but will populate from different text box. how can i do that?
Sep 10 '09 #3

acoder
Expert Mod 15k+
P: 16,027
Similar, but just change the ID of the element when using document.getElementById to get access to it.
Sep 10 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.