Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a message box in a browser...

Status
Not open for further replies.

WildWest

Programmer
Apr 2, 2002
111
0
0
US
Hi All. I have an online form with a submit button. When a user clicks submit, I need a message box to say "Would you like to record this record as complete?" - with both yes/no buttons on it. When 'yes' is selected, it loads yes.html. When 'no' is selected, it loads no.html.

Please advise if you can... Thanks a bunch!!!!
 
Hi,
May be this code helps you.

Code:
<HTML>
<TITLE>TRY</TITLE>
<head>
<script language=&quot;JavaScript&quot;>
function confirmit()
{
	var result = confirm(&quot;Do you want to continue ?&quot;)
	if(result==true)
		alert(&quot;Mark as yes&quot;)
	else
		alert(&quot;Don't mark as yes&quot;)
}
</script>
</head>
<BODY onload=&quot;javascript:confirmit()&quot;>
</BODY>
<HTML>

[atom]

 
I'd do it like this:
[tt]
function confirmit() {

if (confirm(&quot;Would you like to record this record as complete?&quot;))
document.location.href = &quot;yes.html&quot;

else
document.location.href = &quot;no.html&quot;

return true;
}
[/tt]
. . .

<form name=&quot;&quot; action=&quot;&quot; onSubmit=&quot;return(confirmit())&quot;>


Ehm... &quot;to record this record&quot; doesn't sound so good. :)

good luck
 

Super! Thanks ...I'll try!!!!

How about...

&quot;Would you like to mark this record as complete?&quot; or
&quot;Indicate as complete?&quot; or
&quot;Flag this record as complete?&quot;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top