Solved

Verify input

Posted on 2002-06-03
8
137 Views
Last Modified: 2010-04-09
I have a cgi enabled webpage that allows a user to enter data into a database. I would like to add the following ability:

When a user hits submit it echos back the input data and asks the user something like " You entered xxxx, is this correct" . A yes would submit teh data, a no would bang back to the previous page.
Thoughts
0
Comment
Question by:MatthewF
  • 3
  • 3
  • 2
8 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 7051784
you want this in something like a javascript popup, or just on it's own page?


page1 submits to page2 submits to page3.


page1 has the form.  page2 grabs the info from the form, and shows whatever message you would like shown....if the user clicks "accept" page2 already has all the form values from page1 in hidden fields, and submits the form values to page3.  page3 does your processing.  

if on page2 the user clicks "no" then page1 is reloaded, either with or without the values from the form being populated back into the fields.



OR


if the data is a lot smaller (1 field??) then i think you can throw it into a javascript popup with "OK" and "CANCEL" buttons that will fire onsubmit of the form on page1.  if the user clicks ok, they are then brought to page3 which does the processing.  no more need for page2.


BRUNO
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 7051787
<FORM name='myform' action='whatever.cgi' method='post'
   onSubmit='return(confirm("You entered: " + this.myInput.value + ", is this correct?"));'>

  <INPUT name='myInput' value=''>

</form>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 7051790
Sorry Bruno, we were typing at the same time ...
also, I left out the submit button in the form:

<INPUT type='submit'>
0
 
LVL 18

Expert Comment

by:bruno
ID: 7051850
knight,

no worries, as i was just posting thoughts not actual code...


:-)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 12

Accepted Solution

by:
lexxwern earned 75 total points
ID: 7053138
well that can be done in perl itself, /

let confirm.cgi be the file the input comes too,

this file can just show the entered data, and have another form like this ..

print qq(

..show actual data..



<form method="post" action="actual.cgi">
<input type="hidden" name="myname" value="$perlvar"/>
...so so...
...so so...
...so so...
<input type="submit" value="Confirm"/>

);


this would be more reliable as compared to non javascript browsers, and be better for you as you can avoid not learning a new thing...now is this good or bad ? ;)
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7053547
grade B ?
0
 
LVL 18

Expert Comment

by:bruno
ID: 7053648
an no feedback to anyone....
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7056992
update: Ct changed graade on request.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now