Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 453
  • Last Modified:

Open a new window using the CFInput type="button"

I have looked everywhere for this and I can't seem to find it.  I need a button in a coldfusion flash form to open a new window.  I have found an example but I cannot make it work.  I am not sure if it is because I am using CF7.

<cfinput type="button" name="FMMapOneView" value="View" onclick="window.location.assign('FMMapOneView.cfm');">

I can't seem to get this to work.  The form actualy stops loading with this example.
0
myerit
Asked:
myerit
  • 5
  • 4
  • 3
1 Solution
 
mrichmonCommented:
You should look at the HTML being generated.  Often - with cfinput and cfform - Cold Fusion overwrites any javascript code.


Try this:

<input type="button" name="FMMapOneView" value="View" onclick="window.open('FMMapOneView.cfm','MyWindow',width=400,height=400');">

Here is a link with a list of possible attributes (i.e. height, scrollbars, etc) for opening windows:
http://www.pageresource.com/jscript/jwinopen.htm
0
 
pinaldaveCommented:
Repeating what mrichmon said.
1) cfform and cfintput re-writes its own javascript so you can not use onclick on onblur events.
2) regular html is much more powerful and can do all the validation what cfinput or cfform can do also you can use the javascripts. as mentioned in the previous comment.
Regards,
---Pinal
0
 
myeritAuthor Commented:
I was not able to get  mrichmon's example to work.

I have it opening in a new window now using this:

 onclick="getURL('FMMapOne.pdf', '_blank', 'POST');">

I am wondering if there is a way to show some window dimensions as with javascript.  Can you tell the window not to be resizable with the method I am using?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
pinaldaveCommented:
what is your getURL function is ?
May be Javascript Topic Area experts will be helpful to you.
0
 
myeritAuthor Commented:
onclick="getURL('FMMapOne.pdf', '_blank', 'POST');">

This is a typo^

It should read:
onclick="getURL('FMMapOne.cfm', '_blank', 'POST');">
0
 
myeritAuthor Commented:
hmm that may be a possibility thanks I will try that
0
 
mrichmonCommented:
What is not working?
0
 
myeritAuthor Commented:
I cannot get you example to work.  The form does not load at all on the screen when I try your example.  I have tried stripping is down to just onclick="window.open()" and it still will not load the form.  I am using CFINPUT, with flash forms by the way.  I saw that your example showed INPUT.  
0
 
mrichmonCommented:
onclick="window.open()"

will not work - you need to specify what to open.

Yes my example showed input NOT cfinput because as I said you cannot set the onClick for cfinput.

Pinaldave also verified this.  Cold Fusion overwrites what you have.

So you either need to use regular input or have a link that uses onclick.  Basically NOT a cfinput.
0
 
pinaldaveCommented:
Agreed with Mrichmon 100%. Again just "echo" of what he mentioned.

Besides if you are using flash forms with CF7. You can sure not use any of the javascript event at all. It is way different than the regular forms.
Regards,
--Pinal
0
 
mrichmonCommented:
To expand on pinaldave's last comment

I beleive with Flash Forms you use actionscript in place of javascript
0
 
myeritAuthor Commented:
ok
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now