<form name="form2" onSubmit="validateForm2()" action="" method="POST">
<table>
<tr>
<td> <select name="smonth"> <!--some options--> </select></td>
<td><input readonly="readonly" name="day" type="text" size="23"></td>
</tr>
</table>
</form>
<!--java script code -->
function validateForm2()
{
<!--Things to do-->
1.check if both the fields are empty
2.if condition above is true then display error
}
nadeemansari
0
Newbie Poster
Recommended Answers
Jump to PostDepends on how you want to do it. There are many approaches to how to check. One thing you need to know is how to get your "form" element inside your JavaScript. If you use JQuery, it will be different compared to pure JavaScript. Which way are you currently using …
All 4 Replies
Taywin
312
Posting Virtuoso
nadeemansari
0
Newbie Poster
extemer
-17
Junior Poster
Banned
nadeemansari
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.