This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / How to realize such a function in ASP? Every web programmer, especially,Rootbear, gives me some ideas. Thanks a lot, a lot.When visitor submits a form with several fields missed, an error message and return button displays, then the visitor clicks the return button to go back. In this case, the data he entered before should not lost.How to redisplay these data in the form? GAO SHOU please show me how to do it in ASP files? Thanks a lot.
-waokool(waokool);
2002-6-19
{318}
(#586589@0)
-
javascriptsample:
<Script language="Javascript">
function check_field(){
if (document.formname.field_name==""){
alert("please fill up the field_name value")
return false
}
else {
return true;
}
}
</Script>
----
HTML
<form name=form_name action="action.asp" onSubmit="return check_field()">
-nice2002(floater);
2002-6-19
{303}
(#586725@0)
-
Thank you very much. Sorry for late response.
-waokool(waokool);
2002-6-21
(#591430@0)
-
thank you, but doesn't work.
-waokool(waokool);
2002-6-21
(#591528@0)
-
That method works. But you don' t know how to adapt it to your codes! Javascript is capable of perform regular expression check and lots of other type of checks on form fields. Read documentations!
-jeffrey815(Smartiecat);
2002-6-21
(#591563@0)
-
Sorry bugs!<Script language="Javascript">
function check_field(){
if (document.formname.field_name.value==""){
alert("please fill up the field_name value")
return false
}
else {
return true;
}
}
</Script>
----
HTML
<form name=formname action="action.asp" onSubmit="return check_field()">
<input type="text" name="field_name">
<input type="submit" name="Submit" value="Submit">
</form>
-nice2002(floater);
2002-6-21
{426}
(#591791@0)
-
用SESSION变量记住不就得了?
-zhihaoxx(Go!England,Go!);
2002-6-21
(#591554@0)
-
That's so expensive!!!!
-jeffrey815(Smartiecat);
2002-6-21
(#591561@0)
-
用Javascript的history
-hugefox(长得象熊的狐狸);
2002-6-21
(#591571@0)
-
万不得已,慎用。或遵医嘱。
-win(秋天的菠菜);
2002-6-21
(#591837@0)
-
比较简单的方法是,在第二页也build相应的fields,但是类型用HIDDEN,用户看不见,你把前页的值带过来,如果go back, 再把值copy回去。
-luoboyang(萝卜秧);
2002-6-21
(#591573@0)
-
虽然简单,但不是最好的方法。Java script的history应该可以。
-luoboyang(萝卜秧);
2002-6-21
(#591580@0)
-
history back 应该是最简单有效的方法。
-bloor(不老);
2002-6-21
(#591845@0)
-
That's harder for placing a check in the first place when you submit the stuffs.
-jeffrey815(Smartiecat);
2002-6-21
(#591586@0)