JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 16th, 2012, 12:54 PM
chrismichaels84 chrismichaels84 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 23 chrismichaels84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 26 sec
Reputation Power: 0
Other - Pretty simple form question

I have a form that submits to a javascript function and the function opens a window. pretty simple and it works great except that it returns false in some browsers and actually replaces all the content of the parent window with the word "false" what am I doing wrong?

Here's my code:

Code:
<script language="javascript">
function bonus(){
	//alert(document.bonus.code.value);
	var feature = "/interactive/index.php?code=" + document.bonus.code.value;
	window.open(feature,'1352258393691','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,sc  rollbars=0,resizable=1,left=0,top=0,srolling=no');
}
</script>

<div style="position: absolute; z-index: 100; left: 850px; top: 147px; border: 0px;">
<form name="bonus" action="javascript:bonus();">
<input type="text" name="code" size="25" style="border: 2px solid black; width: 160px; height 50px;" value="Type Your Bonus Code" onclick="this.value='';"> 
<input type="submit" value=" Go ">
</form>


I also tried it with onsubmit, same problem. Thanx

Reply With Quote
  #2  
Old November 16th, 2012, 08:24 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 662 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 15 m 9 sec
Reputation Power: 69
Code:
<form name="bonus" onsubmit="return false">
<input type="text" name="code" size="25" style="border: 2px solid black; width: 160px; height 50px;" value="Type Your Bonus Code" onclick="this.value='';"/> 
<input type="submit" value=" Go " onclick="bonus()"/>
</form>

Reply With Quote
  #3  
Old November 18th, 2012, 04:59 PM
chrismichaels84 chrismichaels84 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 23 chrismichaels84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 26 sec
Reputation Power: 0
Thank you

Thank you, it works great!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Other - Pretty simple form question

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap