In the first field if no value is input or is left empty and skipped focus to the next input text field,
- Change the focus to the first input text field
It should prompt an error message on the first input field such as
- "Enter the value in this field first"
There are Requirements and then there are "REQUIREMENTS". One (hopefully) makes your software more standardized and easier/less expensive to maintain. The other is what you get when people hand down ironclad edicts based on thinking they know more than they do. That sort of requirement makes software more expensive, not cheaper. I can help you with the first sort of requirements. The second is less about effective use of technology and more about asserting brute raw power and the only help I can give in cases like that involves updating the CV.
You'll see me saying a lot of "Don't do this" and "Don't do that" in my role as contributor to these forums. Most of the time I'm basing those admonitions on what I've learned the hard way. Not everyone takes my advice, but then again, they're not required to. Nor is it uncommon for me to withdraw an objection once I see what the bigger picture is. It's true. Rules are made to be broken. The key is in knowing when to break them, which is why they're rules to begin with. It's the difference between inexperienced amateurs fumbling around and trying to force things to be the way they think they should be and experienced professionals making calculated decisions. Personally, any time I can do the impossible within the rules I count it a greater victory than doing the same thing by building up an elaborate run-around.
OK. Now on to the problem itself.
I had trouble reading this, as there are at least 2 interpretations. One is that the required field must be populated before the second field at the time of entry. The other would be that an attempt to submit the form would then assert the need for the required item and direct the input focus there.
At first, I thought this was about submitting, but now I'm inclined towards the first explanation. For that one, you should initiate logic in an onfocus event in the second control The logic would test for data in the first control, and if not found, throw up an alert box, followed by a focus() command. So, something sort of like this:
The requireInput script has a pseudo-code something like the following. If you have jQuery at your disposal, it can make the logic simpler.
An IDE is no substitute for an Intelligent Developer.
dinesh laxman kumar
Joined: Jul 11, 2012
And Tim, one of the best gratis ever received
Since I am not well acquainted with xml and parsing methodology,
Will take this discussion to my seniors