Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,261 Programmers. There are 1,903 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Backwards script?

 
Reply to this topicStart new topic

Backwards script?

raeNet
post 4 May, 2008 - 12:47 PM
Post #1


D.I.C Head

**
Joined: 1 Nov, 2007
Posts: 70



This is a very basic form as I am trying to learn javascript. However, my code is working in reverse. When the user clicks submit form and selects "OK" I want to send them to Yahoo.com, but nothing happens. When they click "cancel" they go their and nothing should happen.

Can anyone help me out with this? thank you for any help.

CODE

<script type="text/javascript">
function submitForm()
{
if (confirm('Are you sure you want your name submitted?'))
{
}else{
userform.submit();
}
}        
</script>
</head>
<body text="blue" bgcolor="yellow">
<form action="http://yahoo.com/" method="get" name="userform">
<input type="text" name="username"/>
<input type="button" value="Submit Name" onclick="submitForm();"  />
</form>
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


raeNet
post 4 May, 2008 - 01:00 PM
Post #2


D.I.C Head

**
Joined: 1 Nov, 2007
Posts: 70

Never mind, I understand what I did and corrected it.
Thanks anyway!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 10:15AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month