Add to Google

Javascript/HTML form submissions On a Mac

free web hosting
Open Discussion > Have your say > General Talk

Javascript/HTML form submissions On a Mac

jfgill1
My hope is that someone out there can help me with this problem. I have some javascript that will go thru (on a PC that is) a HTML page looking for a specifc word submitted via an onclick function.

Orginally it was a form submission with an onsubmit that ran the function. But in trying to trouble shoot it I thought the mac was submitting the form differently than the PC versions (maybe the DOM) so I created a button with an onclick command. Again it works for the PC but not for the MAC.

I am at my wits end. If someone can help; below is the code I am using. Including the simple form.

***Start of Code ****
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script>


//var NS4 = (document.layers); // Which browser?
//var IE4 = (document.all);

var win = self; // window to search.
var n = 0;

function findInPage(str) {


var txt, i, found;

if (str == "")
return false;

// Find next occurance of the given string on the page, wrap around to the
// start of the page if necessary.

// if (NS4) {

// Look for match starting at the current point. If not found, rewind
// back to the first match.

// if (!win.find(str))
// while(win.find(str, false, true))
// n++;
// else
// n++;

// If not found in either direction, give message.

// if (n == 0)
// alert("Not found.");
// }

// if (IE4) {
txt = document.body.createTextRange();

// Find the nth match from the top of the page.

for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}

// If found, mark it and scroll it into view.

if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}

// Otherwise, start over at the top of the page and find first match.

else {
if (n > 0) {
n = 0;
findInPage(str);
}

// Not found anywhere, give message.

else
alert("Not found.");
}
// }

return false;
}

</script>

<form name="search" method="post" onSubmit="return findInPage(document.forms.search.srch.value);">
<font size=3><input name="srch" type="text" size=15 onChange="n = 0;"></font>
<input type="submit" value="Find">
</form>
HELLO<BR>
GOODBYE<BR>
ROCK N ROLL<BR>
</BODY>


</html>

 

 

 


Reply

jfgill1
In looking in the Javascript Bible 5Th Edition I found out that the command is not part of the DOM for Macs. Sooo.. just figured someone might find that useful. :roll:

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : javascript, html, form, submissions, mac

  1. Html Email
    (3)
  2. Does This Link Work For You?
    http://68.203.246.27:8080/index.html (6)
    does this link work for you? i need to take a test online but the link doest works =-\
    http://68.203.246.27:8080/index.html ....
  3. Linking CSS to HTML
    (2)
    CODE Linking to an External Style Sheet --- LINK tag The link tag is
    used between the HEAD tags. It is the most common way to link CSS to HTML. REL Attribute
    The REL attribute defines the differences between a persistent or preferred style and an alternate
    style. - Preferred style is the style that is automatically applied to the page. - Alternate
    style is a style which the user could choose to replace the preferred style. MEDIA Attribute
    screen - (default value) for computer screens print - output to a printer ....
  4. Iframe External Link (Javascript)
    (0)
    This code will allow people who use iframes to link to there page, then load the iframe so that they
    can give external links to people that will link directly to the iframe page they want to see.
    now this first part has to be in the head of your document CODE window.onload = function
    setIframe() { var url = window.location.href; var i = url.indexOf("?i="); if( i>-1 ) {
     url = url.substr(i+3);  document.getElementById("body").src = url; } } now this is
    about how your iframe tag should look CODE of course replace th....
  5. Newpass2.html malware
    (0)
    So, I was chatting it up with some people, and this one person says she got hit by some weird piece
    of adware from www.lop.com/.../newpass2.html. So, smart as I am, I click on the link... and now,
    when I maximize my IE window, it's all forced down to the bottom of the screen so that only like the
    top couple of toolbars are visible. Anyone have suggestions? If you need a Hijackthis log...
    Logfile of HijackThis v1.99.1 Scan saved at 10:47:14 PM, on 3/6/2005 Platform: Windows XP SP1
    (WinNT 5.01.2600) MSIE: Internet Explorer v6.00 SP1 (6.00.2800.1106) Running proces....
  6. http://www.cheapdesign.co.uk/pulseradio/index.html
    (7)
    i have not yet completed this website, because i dont currently have webhosting. but my mate has let
    me upload this website temp so that you can see a sneak preview
    http://www.cheapdesign.co.uk/pulseradio/index.html ....
  7. How to send HTML mail to yahoo inbox
    (1)
    I have a Ecard site . I want to send ecard in HTML mail format, but my site alway send to BULK.
    Does anyone know a site where i can send HTML mail to Yahoo Inbox.....
  8. html bilder
    (4)
    i need html bilder some one can help me....
  9. html imput select help
    (0)
    I would like to know, how I delete an options of "imput select" with source code. Thanks....
  10. html imput file
    (0)
    I would like to know if is possible to cange the file of the "html imput file" with source code
    Thanks....
  11. Javascript loading iframes
    (1)
    Im getting this message CODE Line: 14 Char: 3 Error: 'document.getElementByID(...)' is null
    or not an object Code: 0 URL: http://www.stoneddevilinc.com?i=full_site_part_1.html when i
    try to run this code CODE function setIframe() { var url = window.location.href;
    var i = url.indexOf("?i="); if( i>-1 ) {  url = url.substr(i+3);
     document.getElementById("content").src = url; } } window.onload = setIframe();
    with this url CODE http://www.stoneddevilinc.com/?i=full_site_part_1.html to pull up
    this ifra....
  12. Need How MAny On HTML Code or etc.
    (2)
    OKIDOKIE CLICK HERE ....
  13. JavaScript PHP redirecting
    (2)
    Hi there! /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> Is
    there a way to use JS to change a form's submit target based on which submit button was pressed?
    Eg. CODE Register Login Thank you!! Added code tags--CodeFX ....
  14. html
    (6)
    does anyone know if the html used in myspace will work on a normal webpage..?....
  15. javascript
    (3)
    some nice javascript to add in your site CODE cell bg changer .tditem { font-size:
    12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; color: gray; }
    Item 1 | Item 2 | Item 3
    ....
  16. Need: Public_html file...
    (2)
    I deleted it cuzz I thought I didn't need it :S Please someone send me it!!!....
  17. Getting HTML source code of a remote page.
    (2)
    Hi there, I'm trying to get the source code of a page hosted on another domain using JS. I've
    tried a couple of methods but nothing seems to work with pages located on a remote host. I know this
    could be easily done using a server-side script, but my question is: it is possible to do it with
    JS? Thanks in advance.....
  18. A GREAT JAVASCRIPT COLLECTION
    (1)
    Best program containing many Java scripts AA Scripter. Can be downloaded from this link
    http://www.cyberiapc.com/aa/aascripter.htm **Changed all caps to correct case. --CodeFX ....
  19. Excellent site for Javascript Tools
    (1)
    This is the best source for Javascript tools. http://www.codebrain.com/ **Removed all caps
    --CodeFX ....
  20. Browser Redirection Javascript code.
    (1)
    Hi does anyone have a browser direction code( so if someone went to my site with IE it would forward
    to a site telling you to download Firefox). If so could you email it to me : daniel dot maxson at
    gmail dot com Thanks Daniel....
  21. Kickoff Frame Javascript
    (1)
    Hi I have this javascript ------------------------------ CODE if
    (parent.frames.length==0) parent.location.href="Redirect to?" -->
    ------------------------------ Is this the right one for kicking off frames? Dani **Code
    tags added**--CodeFX ....
  22. HTML/vWar Panel
    (0)
    i was wondering if n e body has ever heard of vWar Panel..if not check it out... www.vwar.de very
    great tool for clans and such..but i was wondering if n e body nows what it is and nows how to
    script with html...or however u say..that would b great..well what i meen is combining both of the
    scripts for n html template..cuz it is usually for phpnuke..just its really hard to combine it with
    html..let me no n e body..it would b great to have help...tyvm.bye....
  23. HTML
    (2)
    Hello FNH-Staff/Helpers..i was wondering.. i no very little of cpanel..like most of it..just the
    installing crap is confusing. well i have a www.freewebs.com site.and i was wondering..is there n e
    way to tranfer the files to the cpanel..if so is there n e way that i can get help..i would really
    appreciate great assistance.tyvm for ure time..and hopes to ttyl.bye Invigor8....
  24. HTML
    (4)
    I need a script , I dont know how to o 'If i click the links on my websites,the text in the middle
    of site is change to what it suppose to be...' someone help me.....
  25. html and php
    (7)
    Hello, I wanna put the following html code in my php-nuke website: CODE
    But I can't put it there cause the html tags are not allowed. Can anyone help me? /sad.gif'
    border='0' style='vertical-align:middle' alt='sad.gif' /> Greetz, N!ghtwarr!or....
  26. More HTML templates
    (12)
    QUOTE http://speedydiz.webdynamit.net/kits/kit9/Kit9.zip 
    http://speedydiz.webdynamit.net/kits/kit2/Kit2.zip  
    http://speedydiz.webdynamit.net/kits/kit5/kit5.zip  
    http://speedydiz.webdynamit.net/kits/kit7/Kit7.zip  
    http://speedydiz.webdynamit.net/kits/kit8/Kit8.zip  
    http://speedydiz.webdynamit.net/kits/kit14/Kit14.zip  
    http://speedydiz.webdynamit.net/kits/kit6/kit6.zip  
    http://speedydiz.webdynamit.net/kits/kit12/Kit12.zip  
    http://speedydiz.webdynamit.net/kits/kit3/Kit3.zip  
    http://speedydiz.webdynamit.net/kits/kit11/Kit11.zip   http://speed....
  27. How Long Did it take you to learn HTML
    (78)
    Hey, Im interested in learning HTML and i was just wondering how long you think it might take....
  28. JavaScript--A snow storm
    (11)
    A snow storm: after or QUOTE N = 40;   Y = new Array(); X = new Array(); S =
    new Array(); A = new Array(); B = new Array(); M = new Array(); V = (document.layers)?1:0;
    iH=(document.layers)?window.innerHeight:window.document.body.clientHeight;
    iW=(document.layers)?window.innerWidth:window.document.body.clientWidth; for (i=0; i Y
    =Math.round(Math.random()*iH); X =Math.round(Math.random()*iW); S
    =Math.round(Math.random()*5+2); A =0; B =Math.random()*0.1+0.1; M
    =Math.round(Math.random()*1+1); } if (V){ for (i = 0; i {document.wr....
  29. Basic HTML Tutorial
    (17)
    Here is some basic HTML... I will give an example doc first, and then break it down. Also, will
    give some extras that could make your page fun and interesting! Example Doc: CODE Page
    Title Title Of Article Text.... This will generate something like this:
    Title Of Article (This Centered) Text..... Here are some basic
    tags: Font Color: CODE WORD OR SENTENCE(S) Font Size: CODE WORD OR SENTENCE(S)
    Font Color and Size: CODE WORD OR SENTENCE(S) Scrolling Text: (From Right to....
  30. Your Favorite Html/webdesign Boards?
    Whats yours? (2)
    What is your favorite webdesign/tutorial forum? I have heard lissaexplains forum is pretty good
    (from word of mouth, i have not auctally been there lol) but I dont really go on many unless its my
    last resort, for thoes of you who love tutorial forums what ones are helpful to you and fun to go
    on? Let us know!....

    1. Looking for javascript, html, form, submissions, mac






*SIMILAR VIDEOS*
Searching Video's for javascript, html, form, submissions, mac

*MORE FROM TRAP17.COM*
advertisement



Javascript/HTML form submissions On a Mac