Link to home
Create AccountLog in
Avatar of dashman
dashman

asked on

HTML Code help

I need to have a line in my code that requires a response and I want that response to be the answer to a question before the user can "submit" a form to the owner of the questionare.

Example: what is the sum of 6 + 3? It should be a required field and the answer has to be 9 before the user can successfully hit the "submit" button to send the form.

Below is what I have so far

Thanks for your help

</select>&nbsp; <strong>*What is the sum of 6 + 3?:</strong>

<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="Answer" size="7"><p>&nbsp;</p>

<div align="center"><center><p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

You could user javascript to do that validation.  I don't know what the 'webbot' code does.  But I must tell you that most spammers will skip your form and submit spam directly to your action page.  You must also validate input on your action page to keep spam out.

What does that mean?  If I look at the "View Source" of your page, I can read the action="xx.php" address you are sending the info to.  Then I can simply make up a form on my computer that submits info directly to that page without going thru your form.
Avatar of dashman
dashman

ASKER

I appreciate your response. I am trying to help out a friend with his website. Someone else originally wrote the javascript code. I am familiar with html but not javascript. I understand what you are saying about making up a form but that is not what the bot is doing. I need to have a field that they have to answer correctly. I have looked at some Captcha sites but cannot seem to get any to work. I was hoping for something a little easier but I guess that might be hard to find.

I did look at the form page source and found this line of code. He is using Frontpage (I know that is outdated but we had been able to make all the changes we needed with it) and see that if we could make it read "does not equal 9 then return false" that would do it.. When I look at the html code in Frontpage I do not see the javascript code so I do not know how you access that to change it.

if (theForm.Answer.value == "")
  {
    alert("Please enter a value for the \"Answer\" field.");
    theForm.Answer.focus();
    return (false);
please provide a link to see the page
http://www.neusob.de/projekt/workshop/webbot.htm

I think you need help from an other zone :
https://www.experts-exchange.com/Web_Development/Software/FrontPage/

Try to change the zone of your question or request attention of a moderator (there's a link somewhere in this page)
As it says in the "View Source" of your page, the javascript is generated by Frontpage and is not directly editable in Frontpage.
Avatar of dashman

ASKER

then how do you edit the javascipt and how would you change it to make it a set value? I think you can see that I am a novice at this aspect (been an IT consultant for 20 years) and could use all the help I can get.

Thanks
You would have to stop using Frontpage and do the editing manually.  Wait and see if anyone from the Frontpage zone has another suggestion.
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account