URL Button to show a form element in pop up window?

  • 1
  • 3
  • Question
  • Updated 2 years ago
  • Answered
Basically, this is just an aesthetic request.  How can I have a javascript window to pop up and show a specific field?  ie

<button: Show name >

Pop up window:
George Washington
Photo of Tony

Tony

  • 226 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
  • 3
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
Yes, this can be done, but I'm sure you are looking to show more that just a name.  Do you have any more details of what you are trying to do?
Photo of Tony

Tony

  • 226 Points 100 badge 2x thumb
Just a button that when pressed a small pop up appears with the information within that field shows up.  That was just an example.  

Thanks
Tony,
Here is a low tech solution which does not require javascript.

Make a URL formula button set to open in a new window (there is a checkbox for this)
URLRoot() & "db/" & dbid() & "?a=dr&dfid=10&rid=" & totext([Record ID#])

This will not be a small pop up though, it will be a new tab and it will open up form ID# 10 which would be a new super mini form why just that field on it.

if you like you can put this Text formula button with html enabled on the form to help the user easily close the Tab.  I'm not 100% sure it works on all Browsers, you would need to test.

var text URL = "JavaScript:window.open('','_parent','');window.close();";
var text Image = "<img src=https://images.quickbase.com/si/48/832-close.png>";

"<a href=" & $URL & ">" & $Image & "</a>"
Photo of Tony

Tony

  • 226 Points 100 badge 2x thumb
Thanks.  I'll take a look and play around with it.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Mark, is there an option to open the pop up form in edit mode? And could this be shrunken window just big enough to show 2-3 fields?  
If you change the dr to er here URLRoot() & "db/" & dbid() & "?a=dr&dfid=10&rid=" & totext([Record ID#]). It will open in edit mode.

Sorry , but I do not know how to make it open in a smaller popup box.

I belive that I do have code for a big X so the use has something to big click in to close the new tab. I can look for that if you need it.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks a lot. This works well.  
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
If you want to open a small pop-up window via an HTML text page, you'll want to use a combination on 

onclick=\"var a=window.open('"&URLRoot().....

and

'newwindow', 'width=600,height=200');

The URL would direct to your specific form, and the new window call would make it a pop-up, and then jsut set your size.
Photo of rocketc

rocketc

  • 824 Points 500 badge 2x thumb
Matthew,

I'm using a URL formula field to build a URL link to an external site.....I would like to create a Text formula field that uses the code you suggested to open my [URL formula field] into a pop-up window. Would you mind sharing with me what the code would be -- that I would need to use within my formula text field? thank you!
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Matt, sorry took a while to thank you. Could you advise how to set it up, I mean, how to use the syntax you have kindly sent.