Stump the Panel » End Users and Information Workers

Javascript Form or HTML with Form Tag

(8 posts)
  • Started 2 weeks ago by constantandtrue
  • Latest reply from constantandtrue
  1. I have two options for embedding code that will display a Form that is designed to collect and submit Name and Email.

    I can't seem to get either code to work in the oob web parts. Can you help?

    The two options are Javascript

    <script type="text/javascript" src="http://forms.aweber.com/form/22/deleted_file_name.js"></script>

    Or HTML

    <center><form method="post" action="http://www.aweber.com/scripts/addlead.pl">
    <input type="hidden" name="meta_web_form_id" value="deleted form ID">
    <input type="hidden" name="meta_split_id" value="">
    <input type="hidden" name="unit" value="sharepointtips">
    <input type="hidden" name="redirect" value="http://www.aweber.com/form/thankyou_vo.html" id="redirect_00d510793a19d657cce5d9280ac4c9d5">
    <input type="hidden" name="meta_redirect_onlist" value="">
    <input type="hidden" name="meta_adtracking" value="">
    <input type="hidden" name="meta_message" value="1">
    <input type="hidden" name="meta_required" value="from">
    <input type="hidden" name="meta_forward_vars" value="0">
    <table>
    <tr><td colspan=2><center></center></td></tr>
    <tr><td>Name:</td><td><input type="text" name="name" value="" size="20"></td></tr>
    <tr><td>Email:</td><td><input type="text" name="from" value="" size="20"></td></tr>
    <tr><td colspan=2><center></center></td></tr>
    <tr><td align="center" colspan="2"><input type="submit" name="submit" value="Submit"></td></tr>
    </table>
    </form>

    <img src="http://forms.aweber.com/form/displays.htm?id=jMzMjJyMbJxMTA==" border="0" />
    </center>

    Posted 2 weeks ago #
  2. Did you try putting that in a Content Editor Web Part?

    Posted 2 weeks ago #
  3. What's the goal here? Trying to auto-populate regular SharePoint fields?

    Laura

    Posted 2 weeks ago #
  4. Rats, I'm vague again. Sorry... This is a form to send name and email to an email marketing host that will allow me to send out newsletters to clients who sign up with the form. If I use the javascript code in a Content Editor Web Part it completely hoses the site. I can't edit the page or edit the web part. This was a test site so i just deleted the site rather than trying to sort it out with Designer or worry too much. I did this twice...

    If I use the HTML version I get the error:
    <FORM> tags are not supported in the HTML specified in either the Content property or the Content Link property. You can remove the <FORM> tag, or use the Page Viewer Web Part, which supports the HTML <FORM> tag.

    The Page Viewer Web Part sort of works, but the form is designed to take the user to another page after submit that doesn't work well in the Page Viewer Web Part. I can work with this awhile to see what I can devise...

    I was just hoping for a lead on a Web Part that accepts javascript or HTML <form>. Or something that I may be missing.

    I know I'm asking a lot of questions lately. For the record, I've answered way more than I've asked and only ask when other research sources lead to a dead end. I really appreciate having this outlet.

    Regards,

    DR

    Posted 2 weeks ago #
  5. eric
    Moderator

    I seem to recall that the CEWP does not like form tags when I created a custom search web part. Looking over my code I see there is no form tag in it, but it does use java script:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function Search()
    {
    if (document.getElementById('Google').checked)
    window.open("http://www.google.com/search?q=" + document.getElementById('Search').value);
    if (document.getElementById('Collab').checked)
    window.open("https://MySPDomain/SearchCenter/Pages/Results.aspx?k=" + document.getElementById('Search').value);
    else window.open("http://google.OurDomain/search?site=default_collection&client=ecu_frontend&output=xml_no_dtd&proxystylesheet=ecu_frontend&q=" + document.getElementById('Search').value);
    }
    // -->
    </SCRIPT>

    <table cellpadding="0" cellspacing="0" align="center"><tr>
    <td class="ms-sbcell">

    <INPUT TYPE ="Text" NAME="Search" class="ms-sbplain" alt="Enter search words" SIZE ="40" />
    </td>
    <td class="ms-sbgo ms-sbcell">
    <img title="Go Search" onmouseover="this.src='/_layouts/images/gosearch.gif'" onmouseout="this.src='/_layouts/images/gosearch.gif'" alt="Go Search" src="/_layouts/images/gosearch.gif" style="border-width:0px;" />

    </tr>
    <tr></tr>
    <tr>
    <td class="ms-sbcell">
    <label>
    <input name="radio" type="radio" id="Google" value="Google" checked="checked" />
    Google Search</label>
    <label>
    <input id="ECU" type="radio" name="radio" value="ECU" />
    ECU Search</label>
    <label>
    <input id="ECU" type="radio" name="radio" value="Collab" />
    Collab Search</label>
    </td>

    </table>

    Posted 2 weeks ago #
  6. Thx Eric, I'll try using some of your code to see if I can get it to work properly.

    Posted 1 week ago #
  7. The CEWP doesn't accept forms. But this seems to be a job for the Form Web Part...

    Posted 6 days ago #
  8. I tried the javascript in CEWP and this time it worked. I'm not sure why it was locking up my browser in previous attempts. It seems to be working fine now.

    Posted 4 days ago #

RSS feed for this topic

Reply

You must log in to post.