What I am trying to achieve is a button that, when pressed will read which radio button the person has pressed and then will launch a relevant pop-up window depending on whether they pressed the ‘b’ radio button or if they’ve pressed something other than b(which will then popup with a different window).
hmm… looks about like what she was discribing. Should help anyway.
Question though… as this works, all the answers are stored on the html page that contains the questions. Is there an easy way, without using CGI to contain those answers in a separate file, elsewhere on the server?
Laurie didn’t ask, I’m just interested in that answer
She could copy and paste the content between the script tags (she can delete the script tags), put it in an external .js file (can save one of these in notepad, just save as “All Files” and put the extension .js at the end). And then insert the code into the page like this…
She can probably cleverly disguise the name of the .js file so people think it doesn’t have to do with the quiz thing.
When the source is viewed, the script right above will show, not the actual script that she has in the .js file.
[edit]Hey david, did you ever check out that script I sent you for dynamic pop-ups in Flash or something like that. It was a while ago, but I just saw the file on my comp and it reminded me of it [/edit]
I probebly have not. I’ve been having difficulty getting on Flash and doing any work with it for quite some time now. Send it again, I’ll look at it, I promise. (ps MX still isn’t working yet, so I need it in 5.0 version if possible)
Hrmm, I believe this is the file. I think I had a friend to it for me on Flash 5, so you could open it. I don’t have the .zip file, so I hope I didn’t open it and save it again as Flash MX… :-\
I remember you wanted the page to load from your variable name or something along those lines.
its me again,
I realized that in picking an answer to the question,you should only be able to pick one radio button. I know that when you keep the name the same throughout the buttons it allows you to do this, but since I need the names to be different on every one,(for the if/then statement to work) I can’t do this.
There must be a way!
I think I am a lil bit confused as to what the difference is between a name and a value is.
~Laurie
I checked the results directly from the name, but completely forgot to check the id (or add the id for that matter). This is actually my first time doing this so I was bound to make a mistake…lol.
Ok, I have attached a new .zip file. This one should work with only checking one item.
Please note that I added an id=“x” (x = some letter) into each of the radio button form elements. This gives each button a specified id, while keeping the same name.
Oh yeah, as for names and values…
Name = Assigns an identifier to the element.
Value = Preassigns a value for the input element for submission to the server. Basically, the name given under value is what the server reads after you submit the form(or at least I believe that is how it goes)
LOL, ok, so the change I made in this one is probably unnoticeable, but I uploaded it anyway.
Can you spot the difference (that is, if you downloaded the other file)? They both work either way, the second one is just slightly… optimized (???)…lol… if you could call it that.
Hi Lostinbeta-
I have not had the opportunity to download 2.0 of formtest, but have a question. In netscape communicator 4.7 the pop-ups are not working, works in 4.0 -bazaar- but if I go into the built in javascript debugger it says the first line of the javascript code does not have any properties. Do you know what this could be? The only reason I’m asking is because the clients target browser is <g> 4.7
Thanx for the alt. code,
unfortunately netscape 4.7 is not accepting that either-javascript error. Could it be that that version did not accept a certain kind of command?
Is there any other way to get the same results while changing the code?
I’m working on this myself, but with the limited knowledge I have right now of JS it proves to be difficult.
I found out why its not working. I looked in my dreamweaver reference guide and is says that Netscape Navigator does not support the ‘id’ tag. I tried the html document that we had before we changed it to ‘id’ and it works!!!
At least I’ve found out the problem, -now I just don’t know the solution!
I’m so psyched to have been able to partially solve the problem.
~L
I have tried and tried and tried and tried and tried some more, but I can’t find a way to return results based on the value instead of the ID of an item
Since the ID is the actual locator of the object, the script you current has says “if this location is checked, then do this”, but without a locator, it can’t check what is checked :-\
I didn’t even know people still used that version of Netscape :-\
HA!
You would be SURPRISED at what ancient browsers corporate america is using these days
Anyway, I decided to go about it in a different way(god knows what kinds of problems I will run into with this one):
<form name="form">
<input type="radio" name="one" value="a">
<font size="2" face="Arial, Helvetica, sans-serif">a. 5 years
in prison and/or a fine of up to $125,000 </font></p>
<p>
<input type="radio" name="one" value="b">
<font size="2" face="Arial, Helvetica, sans-serif">b. 10 years
in prison and/or a fine of up to $250,000 </font> </p>
<p>
<input type="radio" name="one" value="c">
<font size="2" face="Arial, Helvetica, sans-serif">c. 20 years
in prison and/or a fine of up to $500,000</font></p>
<p>
<input type="radio" name="one" value="d">
<font size="2" face="Arial, Helvetica, sans-serif">d. None of
the above</font></p>
<p><font size="2" face="Arial, Helvetica, sans-serif">
<input type="Reset" name="Reset" value="Reset">
<input type="Button" name="Button" value="Submit"
onClick="if (this.form.b.checked){
_____MM_openBrWindow('1right.html','','width=230,height=150');
__}
__else {
_____MM_openBrWindow ('1wrong.html','','width=230,height=150');
__}
}">
</font></p></form>