
phpQuestioner
Members-
Posts
1,485 -
Joined
-
Last visited
Never
Everything posted by phpQuestioner
-
try this: <script language="javascript"> function checkZIP() { var zippy = document.getElementById('zipcode').value.length; if (zippy < "5") { alert("Please Enter A Valid Zip Code"); } else { document.zipform.submit(); } } </script> <form name="zipform" action="gasfinder.php" method="post"> Zip Code: <input type="text" name="zip" id="zipcode" maxlength="5"> <input type="button" value="Get Gas Now!" onclick="checkZIP()"> </form>
-
How to identify the page type on the current page
phpQuestioner replied to optikalefx's topic in Javascript Help
ok - try this; I had to change a few things, sorry made a mistake or two. <script language="javascript"> var presently = document.URL; var thisFile = presently.split("/"); var thisExt = presently.split("."); var total = thisFile.length - 1; var totaled = thisExt.length - 1; function getFileNameAndExt() { if (total > "3") { document.getElementById('viewIt').innerHTML = thisFile[total] + '<br/><br/>'; } else if (totaled == "2") { document.getElementById('viewIt').innerHTML='index.' + thisExt[totaled] + '<br/><br/>'; } else { document.getElementById('viewIt').innerHTML='Unknown'; } } </script> <div id="viewIt"></div> <a href="javascript:getFileNameAndExt()">Where Am I At? - Click Here To Find Out</a> -
I really need help with my script Im really Confused
phpQuestioner replied to winmastergames's topic in Javascript Help
an easier way to do this would be to use php or ajax to submit each form value back to each specific field's value. -
How to identify the page type on the current page
phpQuestioner replied to optikalefx's topic in Javascript Help
try changing this: if (total > "2") to this: if (total > "3") -
How to identify the page type on the current page
phpQuestioner replied to optikalefx's topic in Javascript Help
here is a workaround for unknown "index" page extensions: <script language="javascript"> var presently = document.URL; var thisFile = presently.split("/"); var thisExt = presently.split("."); var total = thisFile.length - 1; function getFileNameAndExt() { if (total > "2") { document.getElementById('viewIt').innerHTML = thisFile[total] + '<br/><br/>'; } else { document.getElementById('viewIt').innerHTML='index.' + thisExt[total] + '<br/><br/>'; } } </script> <div id="viewIt"></div> <a href="javascript:getFileNameAndExt()">Where Am I At? - Click Here To Find Out</a> -
I really need help with my script Im really Confused
phpQuestioner replied to winmastergames's topic in Javascript Help
winmastergames, when I wrote that javascript; I set it up to only pull the data from two fields/variables values and turn it into a string; which is the way your asking for it to be done; but some how your thinking that you want it to pull more than two form fields/variables values and turn it into a string. that is not the way I designed the script; because you were only asking for the title and the slogan variables to be converted into a string. are you wanting more then two variable turned into a string? are you wanting all the variables in each specific form turned into a string? -
How to identify the page type on the current page
phpQuestioner replied to optikalefx's topic in Javascript Help
try this: <script language="javascript"> function getFileNameAndExt() { var presently = document.URL; var thisFile = presently.split("/"); var total = thisFile.length - 1; if (total > "2") { document.getElementById('viewIt').innerHTML = thisFile[total] + "<br/><br/>"; } else { document.getElementById('viewIt').innerHTML='index.html'; // usually the domain is pointed towards the "index" page; but the extension my vary } } </script> <div id="viewIt"></div> <a href="javascript:getFileNameAndExt()">Where Am I At? - Click Here To Find Out</a> -
Post your code, so I can take a better look at it.
-
well your probably going to at least have to create a hidden input field to record the key strokes. you well need to set up your php page to search your database; do something like this: <?php // connect // select db $hiddenfieldvariable = $_GET['hiddenfieldname']; $results = mysql_query("select * from where id like '$hiddenfieldvariable%'"); // then go from there ?>
-
[SOLVED] How to catch form-submission events?
phpQuestioner replied to kratsg's topic in Javascript Help
uh - yeah you were being rude; let me point out you little rude and obnoxious statement above. good luck with that pal; cause I will not be helping you with it. -
your going to have to add your css style inline or with javascript for your "scrollImage" image's style. that is how javascript recognizes the style of the element. here is the your code below; I changed it around a little bit; so that it would not throw errors. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>scroll test</title> <script> var W3CDOM = (document.createElement && document.getElementsByTagName); var count = 500; function init(){ if (!W3CDOM) return; animationController(); } function animationController(scrollImage){ var intervalId = setInterval("animate()", 200); setTimeout("animationController()", 3000); } function animate(){ var scrollImage = document.getElementById('scrollimage'); var amount = document.getElementById('scrollimage').style.left; alert("Do I have the image: " + scrollImage.id); alert("Left value: " + amount); if(count != 0){ amount = parseInt(amount) + 1 + 'px'; alert("Left value: " + amount); count--; } else{ scrollImage.style.left = '2px'; count = 500; return; } } window.onload = init; </script> </head> <body> <img id="scrollimage" src="Bergeron_Patrice.jpg" alt="" style="position:absolute;left:2px" /> </body> </html>
-
How to identify the page type on the current page
phpQuestioner replied to optikalefx's topic in Javascript Help
here is a better version of my script above. this version will use some math too automatically find the amount of forward slashes, so it will always pull your file name and extension from the url. it shouldn't matter how long the url is; I tested it in up to 5 sub-directories and each time it gave me the filename with the extension. so I hope the version works out better for you. <script language="javascript"> function getFileNameAndExt() { var presently = document.URL; var thisFile = presently.split("/"); var total = thisFile.length - 1; document.getElementById('viewIt').innerHTML = thisFile[total] + "<br/><br/>"; } </script> <div id="viewIt"></div> <a href="javascript:getFileNameAndExt()">Where Am I At? - Click Here To Find Out</a> -
can you post your entire code (with html and javascript); that way I can get a better concept of your problem, by viewing your demo?
-
you need to have your "subcontent" div in the same container as your image is in. set the css style display to "block". change the margin-top and margin-left as needed. although I did not see it in the code you have posted on this thread (I didn't look at the code on your page) make sure you are not setting the top and left css attributes for your "subcontent" div.
-
How to identify the page type on the current page
phpQuestioner replied to optikalefx's topic in Javascript Help
glenelkins is right; the best way to do this is server side, but it can be done through javascript. the only draw back is, that you would need to know how many forward slashes were in your url. this can be probably done with a little bit of javascript math. but the basic idea is below - good luck <script language="javascript"> function getFileNameAndExt() { var presently = document.URL; var thisFile = presently.split("/"); document.getElementById('viewIt').innerHTML = thisFile[3] + "<br/><br/>"; } </script> <div id="viewIt"></div> <a href="javascript:getFileNameAndExt()">Where Am I At? - Click Here To Find Out</a> -
It looks to me like you would need to create a html element like a link or a image and add the onmouseover event to it; with the dw_scrollObj.initScroll function to it.
-
[SOLVED] How to catch form-submission events?
phpQuestioner replied to kratsg's topic in Javascript Help
Well since I was edited; I will say it in a nicer way (I would hate to offend someone who is being rude to me ober - that is sarcasm by the way, in case you didn't know); you will not be getting any help from me on this; because you cannot talk to people in a nice way. We are not here to meet your demands; we here to assist your for free. We don't get paid to provide you a service. If you continue to talk to people in that fashion kratsg; no one is going to ever help you on here. -
Also; display it as a block element; that way it should break after the element above it.
-
You don't need to double post in the forum to get help refer to this thread: http://www.phpfreaks.com/forums/index.php/topic,179329.0.html
-
You don't need to double post in the forum to get help Play around with the margin and left and top positioning.
-
[SOLVED] How to catch form-submission events?
phpQuestioner replied to kratsg's topic in Javascript Help
Well I guess I didn't read your post exactly right, *snip* edit by ober: there seems to be confusion on both sides. Please keep it civil and avoid name calling. -
[SOLVED] How to catch form-submission events?
phpQuestioner replied to kratsg's topic in Javascript Help
well if that is what your trying to do; give each of your forms a hidden input field and name each field something like "formselector" and then give each of the different hidden input fields a value for whatever you want the form to be called; do this with each of your forms. then set up your php script to receive this "formselector" variable. this way you can distinguish between what form sent you the data to the php script. -
[SOLVED] How to catch form-submission events?
phpQuestioner replied to kratsg's topic in Javascript Help
you want your php to know which form it is? is that what your trying to do?