Show string in a new window

Post Reply
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Show string in a new window

Post by barry.marcus »

What I want to do is probably very simple, but I'm vortex/HTML neophyte...

I have a form with a SUBMIT button. I also have a function that performs a search, formats the search results into a string, and places the string into a variable named $rString. Here's what I want: When the user clicks the button, I want the value of $rString displayed in a text box in a new browser window. The new window also has a Close button. That's it.

Simple, I think. But how?

Thanks in advance.
User avatar
jason112
Site Admin
Posts: 347
Joined: Tue Oct 26, 2004 5:35 pm

Show string in a new window

Post by jason112 »

barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Show string in a new window

Post by barry.marcus »

Sorry. That doesn't seem to work, but I'm sure it's because I don't clearly understand what to do. The following does not cause the results to open in a new browser. CreateMarkedUpFilter is the name of the function that creates the string $rString. The button is in a form which is created by a another function called "Preview Filter". I cut out a lot of stuff, but basically here's what I have in my vortex file:

<a name="Preview Filter" PUBLIC>
<form method="post" action="$url">
<input type="submit" name="cmd" value="Show Filter">
</form>
</a>

<a name="Show Filter" PUBLIC target=_blank PUBLIC>
<CreateMarkedUpFilter>
<input type="text" name="displayFilter" value="$rString">
</a>
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Show string in a new window

Post by John »

The target=_blank goes in the <form> tag, e.g.

<form method="post" action="$url" target="_blank">
John Turnbull
Thunderstone Software
User avatar
jason112
Site Admin
Posts: 347
Joined: Tue Oct 26, 2004 5:35 pm

Show string in a new window

Post by jason112 »

and this is assuming that "$url" is something that will print "displayFilter".

If it's not (and already does some other logic), it might be easist to do this with a javascript alert(), or maybe a confirm() window to verify that.

If this still isn't making sense, we should take a step back and review what behavior is actually desired, as I'm still not 100% clear on that (specifically in regards to $url).
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Show string in a new window

Post by barry.marcus »

OK. I understand. Now I see my mistake, and yes, that works. But here's a wrinkle... The button which is to bring up a new browser window is not the *only* button on the form. Clicking the others should NOT result in a new browser. Only the "Show Filter" button should bring up a new window. Is that do-able?

Thanks again.
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Show string in a new window

Post by barry.marcus »

Jason, I posted my last response before I read your most recent. Sorry.

Ideally, all I really want is a simple popup window that shows a text string. That's it. Period. My last post referred to the fact that the button that the user clicks to show the popup is one of several buttons on the form. If I change the <form> tag, it seems that all the buttons on the form result in a new window, which I don't want.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Show string in a new window

Post by mark »

You could use <button onclick="..."> to do a javascript alert or open a new window. You may have to put it in a separate form, not sure. This is an HTML authoring issue. You might find more help at any of dozens of HTML help sites.
User avatar
jason112
Site Admin
Posts: 347
Joined: Tue Oct 26, 2004 5:35 pm

Show string in a new window

Post by jason112 »

The popup window contains the text you want correct?

So the only problem left is that the othe buttons also popup when you don't want them to?

If that's the case, then you'll need some javascript to change the "target" attribute of the <form> when that button is pressed.

You can use the onClick() event handler to execute some code that sets the target to "_blank", and all the other buttons can have an onClick that sets the target to "_self".
Post Reply