hello friends
i like to validate a form designed in php and html with java script.
i had used the image to link on the other page.
snap shot of the code i am using::
echo"<form method=POST action=frmdisplay.php>";
echo"<input type=text name=txtname size=30>";
echo"<a href=frmdisplay.php><image src='test.jpg'></a>";
echo"</form>";
now i like to validate the text box that if it is not filled the n it should prompt what should i do.
plz send me the code to do this.
i also like to ask that can i use the value passed in the javascript func. in the php in the same page
how can i validate a form designed in php using javascript
Moderator: General Moderators
- softsolvers
- Forum Commoner
- Posts: 75
- Joined: Fri Feb 13, 2004 4:26 am
- Location: India
- Pointybeard
- Forum Commoner
- Posts: 71
- Joined: Wed Sep 03, 2003 7:23 pm
- Location: Brisbane, AUS
- Contact:
well php just renders a page for display, the javascript would still execute normally in the final page. All you gotta do is place the javascript in as per normal. Theres heaps of tuts around for that sort of thing. Try googling.
Form Validation Javascript
took me 2 sections.
-PB
Form Validation Javascript
took me 2 sections.
-PB
- softsolvers
- Forum Commoner
- Posts: 75
- Joined: Fri Feb 13, 2004 4:26 am
- Location: India
i am a bit specific i am showing you the code from where i want to call the validation function
i am taking :
<input type=image src="path" onclick="call function">
now each time itr is returning to the true value while i am wanting that iff the field is not filled then it should stay on the same page
i am taking :
<input type=image src="path" onclick="call function">
now each time itr is returning to the true value while i am wanting that iff the field is not filled then it should stay on the same page
- Pointybeard
- Forum Commoner
- Posts: 71
- Joined: Wed Sep 03, 2003 7:23 pm
- Location: Brisbane, AUS
- Contact: