Hi guys, first i hope u will understand me...
So i want to make a javascript to be shown if somebody chooses option A to show the javascripts for the A1,A2,A3 and if they choose B to show javascripts for the B1,B2,B3. So the A and B it will firstly asked as options from a <select> tag
eg.
<SCRIPT language=JavaScript>
<!--
function check(form) {
if (form.Password.value == "")
{ alert("Please enter your Password."); form.Password.focus(); return;}
if (form.Password.value.length < 8)
{ alert("Please enter a valid Password."); form.Password.focus(); return;}
form.submit()
}
//-->
</SCRIPT>
P.S: I don't want to make complications when they choose A to get B option javascripts or reverse.
Ok sorry Fou-Lu, ...btw i hope anybody understood ..... i meant if We select OPTION A there will be shown some Input-s ....and javascript will ask only for the shown input-s so it means OPTION A input-s ... but not to ask for OPTION B input-s too even that they're not shown cause we didnt select OPTION B ... i hope i explained a little for you.
Well, for starters, you have to use the ONCHANGE event of the <select> to change *WHAT* is displayed. That is, to show one or the other set of questions/fields.
Have you done that?
You don't even show what those other questions/fields are in your post.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Well, for starters, you have to use the ONCHANGE event of the <select> to change *WHAT* is displayed. That is, to show one or the other set of questions/fields.
Have you done that?
You don't even show what those other questions/fields are in your post.
Hi Old Pedant, thanks for the reply, . i want the javascript to be shown if we don't fill input-s on the form , so the first INPUT (selcet tag) is the main one that includes Option A and Option B, like this:
Then, once we choose Option B there down will be shown few more input-s (like i said above: B1,B2,B3) , and i want same thing to happen if we choose Option A, so it will show DIFFERENT input-s (A1,A2,A3) , so essence is that i want this javascript to ask for input-s that are shown after choosing an option A or B , but not ask for ALL input-s , only the once that will be shown after selecting an option.
Then, once we choose Option B there down will be shown few more input-s (like i said above: B1,B2,B3) ...
Yes, I know. And I wanted you to show us how you will present B1,B2,B3 and what kind of fields they are, etc., etc.
Don't make us create a dummy HTML page for you just to demonstrate this simple code, only to find out that our dummy HTML isn't anything like what you wanted.
Give us the HTML with *ALL* fields (A1,A2,A3 as well as B1,B2,B3) *FIRST* and then it's easier to show you how simple the code is.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Yes, I know. And I wanted you to show us how you will present B1,B2,B3 and what kind of fields they are, etc., etc.
Don't make us create a dummy HTML page for you just to demonstrate this simple code, only to find out that our dummy HTML isn't anything like what you wanted.
Give us the HTML with *ALL* fields (A1,A2,A3 as well as B1,B2,B3) *FIRST* and then it's easier to show you how simple the code is.
Hi again, idk if im allowed to send a link, but here is it: LINK
use view-source to view what i included there, thank you so much , once again!
I tried to go to your link, but it just gives a message saying the index page is missing.
If you need more help, post a corrected link. Yes, posting links that show code like that is not only permissible but encourage. You should only get dinged if it was an obvious attempt at advertising or it linked to a site that had, shall we say, improper content.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.