打开弹出窗口的Drupal自定义字段

I'd like to create a custom field in Drupal 7. This field should have a textfield and a button, when the user click on the button, it open a popup which load an external page, this page generate a link. Then the user copy and past this link in the textfield.
My question is, how can I create this custom field which open a popup window ?

Any suggestions?

Have you tried using Colorbox for building modal ajax dialogs? You could put the necessary fields inside the popup. It is working, and it is also easy to understand.

There are also other modules available like Modal Frame API, Chaos tool suite, Popups API, etc.You can find a lot of modules needed for your purpose. The following links might help you: