Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>stop form action from opening window

stop form action from opening window

mazer
03-17-2006, 01:45 PM
I have a free javascript that shows the results of the submited form in a pop-up window, but this isn't what I want, I want to stop the window from opening completely but I still want the form to submit the data, is there a way to do this? or could I just alter the current javascript to do this? I've just started using javascript in the last two days so please forgive my total lack of knowledge.
Here's the script and the form that I used
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// test variables
var myHeight = 200;
var isResizable = true;

function createTarget(form) {
_target = form.target;
_colon = _target.indexOf(":");
if(_colon != -1) {
form.target = _target.substring(0,_colon);
form.args = _target.substring(_colon+1);
} else if(typeof(form.args)=="undefined") {
form.args = "";
}
if(form.args.indexOf("{")!=-1) {
_args = form.args.split("{");
form.args = _args[0];
for(var i = 1; i < _args.length;i++) {
_args[i] = _args[i].split("}");
form.args += eval(_args[i][0]) + _args[i][1];
}
}
form.args = form.args.replace(/ /g,"");
_win = window.open('',form.target,form.args);
if(typeof(focus)=="function")
_win.focus();
return true;
}
// End -->
</script>

<form action="http://ww9.aitsafe.com/cf/add.cfm" method=get
target="_top;"
onSubmit="return createTarget(this);">
<input type="HIDDEN" name="userid" value="*******">
<input type="hidden" name="lg" value="0">
<INPUT TYPE="HIDDEN" NAME="return" VALUE="http://www.themazecomicstore.com/">
<input type="HIDDEN" name="price" value="<%=price%>">
<input type="HIDDEN" name="product" value="<%=details%>">
<input type="HIDDEN" name="units" value="<%=units%>">
<% If instock = 0 Then
Response.Write("<FONT COLOR=#FFFFFF>Out of Stock</FONT>")
Else
Response.Write("<INPUT TYPE=SUBMIT NAME=action VALUE='Add to Cart'>")
End If
%>
</FORM>


 

TOP

Hyperthreading hurts s
HP sharpens blade PC l
Apple goes for Quad po
Itanium gets scaled do

For more info

HP sharpens blade PC l
Hyperthreading hurts s
can not call click() i
script does not work o
smart menu 
write to an html file 
FireFox doesn't recogn
Changing e.keyCode (e.
Clearing a range creat
UPDATE: My mouse over 

News Archive

onChange Help 
beforeload? vs onload.
Problem with document.
decreasing my javascri
Problem with \\ and \ 
how to stop scrolling?
Change Label Text Colo
Can I forward a page b
2 javascript functions
Validating a textbox 

Related stories:

onload for images that are dynamically generated -- a problem in IE
multiple onsubmit problem
Simple mathematicall formula???
table row display problem
Strange Behaviour
moving the browser window
Quotes in a string
Copy link text to clipboard
Problem with htmlarea

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics