[jQuery] Re: linking two controls

2008-09-17 Thread Richard D. Worth
I'm not sure if this is exactly what you're looking for, but I wonder if
you've looked at the jQuery UI Dialog plugin:

Docs:
http://docs.jquery.com/UI/Dialog

Demos:
http://ui.jquery.com/repository/latest/demos/functional/#ui.dialog

If it interests you and you have further questions, there's a dedicated
jQuery UI mailing list:

http://groups.google.com/group/jquery-ui/

- Richard

Richard D. Worth
http://rdworth.org/

On Tue, Sep 16, 2008 at 2:28 PM, Jan Limpens [EMAIL PROTECTED] wrote:


 ah and by popup i mean something like a modal dialogue on the page,
 not another browser instance.

 On Tue, Sep 16, 2008 at 3:22 PM, Jan Limpens [EMAIL PROTECTED]
 wrote:
  hello,
 
  on several pages I have small forms (plural) with a textbox and a
  button. If I click on the button, a popup shows a search form. The
  results of the searchform are shown in the very same popup as a list
  of radiobuttons/labels. If someone selects a radiobutton, it's value
  should be inserted into the textbox next to the button. Then the popup
  should go away.
 
  This popup (something like a singleton) serves many different pages,
  so I cannot hardwire it. Probably I need to pass a delegate to some
  event the form provides, indicating the originating form. Problem is:
  I have no idea how something like this can be done. Anyone could give
  me a hint or two, or direct me to good resources on similar matters?
 
  The popup looks like that:
 
  form id=article-search-form method=get
  action=${Url.For([EMAIL PROTECTED]:'articles',
  @action:'FullTextSearchAsJson'})}
 input type=text name=fragment /
 input type=submit value=Buscar /
  /form
  form id=article-search-result method
  /form
 
  script type=text/javascript
 src=/script/jquery-1.2.6.min.js/script
  script type=text/javascript src=/script/jquery.form.js/script
 
  script type=text/javascript
 
  $(document).ready(function() {
 $('#article-search-form').ajaxForm({
 dataType: 'json',
 success: fillListWithArticles
 });
  });
 
  function fillListWithArticles(data)
  {
 var list = $(#article-search-result);
 $(list).empty();
 i = 0;
 $.each(data, function(){
 id = article-search-result- + i;
 $(divinput type='radio' value='+this.Id+'
 id='+id+'
  name='article.Id'/label style='float: inherit' for='+id+' +
  this.Name +/label/div).appendTo(list);
 i++;
 });
  }
  /script
 
  --
  Jan
  ___
  [EMAIL PROTECTED]
  www.limpens.com
  +55 (11) 3082-1087
  +55 (11) 3097-8339
 



 --
 Jan
 ___
 [EMAIL PROTECTED]
 www.limpens.com
 +55 (11) 3082-1087
 +55 (11) 3097-8339



[jQuery] Re: linking two controls

2008-09-16 Thread Jan Limpens

ah and by popup i mean something like a modal dialogue on the page,
not another browser instance.

On Tue, Sep 16, 2008 at 3:22 PM, Jan Limpens [EMAIL PROTECTED] wrote:
 hello,

 on several pages I have small forms (plural) with a textbox and a
 button. If I click on the button, a popup shows a search form. The
 results of the searchform are shown in the very same popup as a list
 of radiobuttons/labels. If someone selects a radiobutton, it's value
 should be inserted into the textbox next to the button. Then the popup
 should go away.

 This popup (something like a singleton) serves many different pages,
 so I cannot hardwire it. Probably I need to pass a delegate to some
 event the form provides, indicating the originating form. Problem is:
 I have no idea how something like this can be done. Anyone could give
 me a hint or two, or direct me to good resources on similar matters?

 The popup looks like that:

 form id=article-search-form method=get
 action=${Url.For([EMAIL PROTECTED]:'articles',
 @action:'FullTextSearchAsJson'})}
input type=text name=fragment /
input type=submit value=Buscar /
 /form
 form id=article-search-result method
 /form

 script type=text/javascript src=/script/jquery-1.2.6.min.js/script
 script type=text/javascript src=/script/jquery.form.js/script

 script type=text/javascript

 $(document).ready(function() {
$('#article-search-form').ajaxForm({
dataType: 'json',
success: fillListWithArticles
});
 });

 function fillListWithArticles(data)
 {
var list = $(#article-search-result);
$(list).empty();
i = 0;
$.each(data, function(){
id = article-search-result- + i;
$(divinput type='radio' value='+this.Id+' id='+id+'
 name='article.Id'/label style='float: inherit' for='+id+' +
 this.Name +/label/div).appendTo(list);
i++;
});
 }
 /script

 --
 Jan
 ___
 [EMAIL PROTECTED]
 www.limpens.com
 +55 (11) 3082-1087
 +55 (11) 3097-8339




-- 
Jan
___
[EMAIL PROTECTED]
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339