Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

window.open

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried to open a new window when clicking a submit button. But it fails.
<form name="frmExmSheetInp" method="post"
onSubmit="window.open('m_mark_sheet_scr_mgr.jsp', 'ExmPrt', 'top=110,left=100,toolbar=no,scrollbars=no,location=no,width=380,height=50, status=no')">

<input type="hidden" name="staffID" value=<%=staffID%>>
<input type="submit" name="Submit" value="Input another course">
</form>
What is the problem?
thanks.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this
onSubmit="javascript:window.open('m_mark_sheet_scr_mgr.jsp', 'ExmPrt', 'top=110,left=100,toolbar=no,scrollbars=no,location=no,width=380,height=50, status=no'); return false;">
 
Sophia Choi
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still got the same result
 
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sophia,
A few points:
Firstly, you don't use the 'javascript:' pseudo-protocol when specifying script for any of the 'on' handler scripts (Eric is, I'm sure, slapping his forehead).
Secondly, performing a window open in a submit handler is a rather strange thing to be doing. After all, you will be submitting the form and opening a new window.
What is the effect that you are after, and how is it failing? (Simply saying 'it doesn't work' usually isn't helpful).
hth,
bear
[ July 25, 2003: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Relax Bear. The problem is easily fixed by removing the onSubmit handler and adding the same window.open() function within the onclick handler of the submit button itself.
[ July 27, 2003: Message edited by: Michael McNally ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic