If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Mar 2014
    Member #

    <form>, <iframe>, <object>--AND--XHTML !


    On my "Google drive" I set up a contact form to use on my Web sites. However, in order to customize it, I did not use the embedding code on a Web site page, but copied and pasted the entire <form>...</form> section of the code into my page in order to create a contact form. This eliminated unnecessary links in Google's code, and also allowed me to customize the form with my own CSS.

    Then I found some Javascript code online to validate the email address input and also some Javascript code (not php code!) for a captcha. I also installed code that brings up my own "thank you" page (not the standard Google thank-you page) once the form is successfully submitted.

    Everything works perfectly!


    BUT, I always put all my pages through the W3C validator for XHTML 1.0 Strict. I even have their little success logo at the bottom of every page on all my Web sites. When I proudly put my new contact form page through the validator, to quote Capt. Renault, I was "Shocked! Shocked!" Quite few Items in the code are not supported in XHTML Strict. I did some Goggling and went to many Web sites to find ways to bring the code I had in this contact form up to XHTML Strict standards. After a whole day of fiddling, I have not succeeded. So here's a call for help. I would certainly appreciate any suggestions any of you might have.

    Current Non-XHTML Code

    The following code is just before the <form> tag; the <form> tag itself is also displayed here, and the <input> submit tag later in the code is shown as well--

    <script type="text/javascript">
    <script type="text/javascript">
       var submitted=false;
    <iframe name="hidden_iframe"
    <form action="" method="post" id="ss-form" target="hidden_iframe" onsubmit="return checkform(this)">
    <input type="submit" name="submit" value="Submit" id="ss-submit" class="jfk-button jfk-button-action "/>
    The function checkform(this) contains all the Javascript code to check the entered email address and for the captcha.

    As you probably know, and as I just found out, XHTML Strict does not support iframe. It also doesn't support the "target" attribute in the <form> tag.

    My Attempts to Fix

    I tried using <object> instead of <iframe>. Couldn't get it to work.

    I tried writing a Javascript function that would execute the Javascript code currently in the <iframe>--

    Nothing I tried either in the <form> tag or the <input> submit tag would execute the function.

    So...any ideas on how I can bring this code up to XHTML Strict standards???

    Thanks so much.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 08:55 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: