SunQuest
 
           JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 27th, 2004, 12:01 PM
panzhuli panzhuli is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 panzhuli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy newbie form question

hi. i am very new to javascript. i have a form with two buttons. they both submit the same form. here is the general gist:

<form method="post" onSubmit="myOpenWindow()">

//some form fields

<input type="button" class="button" onClick="this.form.submit()" value="submit form">

<input type="button" class="button" onClick="this.form.submit()" value="see demo">
</form>


these do the same thing. just user experience different.

and they are supposed to call the function, but appear to just reload the page:

function myOpenWindow() {
myWindowHandle = window.open('demo.html','Demo','toolbar=0,scrollba rs=0,location=0,statusbar=0,menubar=0,resizable=1, width=750,height=600');
}

but it is not working. can anyone suggest a better solution? or tell me why it is not working? i know very little about javascript.

Reply With Quote
  #2  
Old September 29th, 2004, 03:57 AM
duri duri is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 duri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by panzhuli
hi. i am very new to javascript. i have a form with two buttons. they both submit the same form. here is the general gist:

<form method="post" onSubmit="myOpenWindow()">

//some form fields

<input type="button" class="button" onClick="this.form.submit()" value="submit form">

<input type="button" class="button" onClick="this.form.submit()" value="see demo">
</form>


these do the same thing. just user experience different.

and they are supposed to call the function, but appear to just reload the page:

function myOpenWindow() {
myWindowHandle = window.open('demo.html','Demo','toolbar=0,scrollba rs=0,location=0,statusbar=0,menubar=0,resizable=1, width=750,height=600');
}

but it is not working. can anyone suggest a better solution? or tell me why it is not working? i know very little about javascript.

Hi,

Can u tell me what myOpenWindow() is doing in the script..

U need to call that function on a user Event right?
Where did u called that ...please change your code to

function myOpenWindow() {
window.open('demo.html','Demo','toolbar=0,scrollba rs=0,location=0,statusbar=0,menubar=0,resizable=1, width=750,height=600');
document.forms[0].submit();
}

and in Form


<form method="post">
//some form fields
<input type="button" class="button" onClick="myOpenWindow()" value="see demo">
</form>


it will work ...Plz revert back to forum for any changes..

thanx

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > newbie form question


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway