Jump to content

Search the Community

Showing results for tags 'value'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 17 results

  1. QUESTION ONE: Please suggest what might be entered where the three ? marks appear in order to achieve the following goal. THE GOAL: See appear the value of mil in the input control text field and have this value become the value of $_POST['item_encllength'] when the form is submitted. var min = $('#min').val(); var sec = $('#sec').val(); var mil = function(min, sec) { var millisec = ((min * 60) + sec) * 1000; return millisec; } $('#item_encllength').mousedown(mil, function() { $(this).???; }); <input id='min' type='number' value='Minutes'> <input id='sec' type='number' value='Seconds'> <input id='item_encllength' form='rss2_feed' type='text' name='item_encllength'> I have experimented in a variety of ways, but have not been able to find the code necessary to achieve my goal. Perhaps my approach to the problem is inappropriate. Roddy
  2. hiding a value

    hi how do i hide the (team_id) value in the below form <option value="' . $row['team_id'] . '' . $row['teams'] . '" ' . $selected . '>' . $row['teams'] . '</option> thanks
  3. check if value exist

    removed solved
  4. Array index by its value (key)

    How to get an array index by its value (key)? Is there a special function for that in PHP? For example, I have an array $a ["zero","one","two"] and a variable $b = "two", I know the value is in the array, but I don't know its index.
  5. Yes I'm a newbie in AJAX '&&' JavaScript. As I'm a pupil here, I find hurdle almost in any code... There is an AJAX code with some number value in it, like 4 - 200, but I can't understand the nature of this digits or what they are indicating... function loadDoc() { var xhttp; if (window.XMLHttpRequest) { // code for modern browsers xhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { document.getElementById("demo").innerHTML = xhttp.responseText; } You see: "== 4 && xhttp.status == 200)" ... what for? Thanks to anyone who'll reply to this 'double-dumb' question!!
  6. I'm trying to validate a form at submittal. The code for my web page is written in php (i.e. server-side). The php file consists of a body file (i.e., body.php) included in a header file (i.e. tool.php). The included body file contains the html code for the body with form. The following php code is inserted at the top of the body file (i.e., before the html <body> and <form> fields: <?php //Check the validity of the data entered $activity01 = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { $activity01 = $_REQUEST[activity01]; include($_SERVER['DOCUMENT_ROOT'].'included_filesincPHP1.inc'); $cxn=mysqli_connect($host,$user,$password,$database) or die ("Couldn't connect to the server."); $result = mysqli_query($cxn, "SELECT counter, Activity_Task FROM jsaheader WHERE Activity_Task = '$activity01'"); $counter = mysqli_num_rows($result); $row = mysqli_fetch_assoc($result); if ($counter == 0) { mysqli_close($cxn); } else { mysqli_close($cxn);?> <SCRIPT type="text/javascript"> window.alert("The 'Activity / Task' that you have selected is not unique. There is already another JSA with the name '<? echo $activity01 ?>.' As each 'Activity / Task' must be unique, you will now be returned to the previous page so that you can select a unique 'Activity / Task.'");</SCRIPT> <? } } ?> The problem input field is a text field located within the included body file. The input field content looks like this: <INPUT type='text' size=75 id='activity01' name='activity01' value='<? echo $activity01;?>'> When the form is submitted, the php code shown above queries a SQL database to verify that the activity is unique. I've verified that this is actually working. If it is not unique, the user is informed of this through a popup alert and returned to the form. They actually never leave the form. Because of the code within the value attribute, the previously entered activity is supposed to be shown in the input field as it was originally entered. It doesn't but when I look at the source code it shows up there as "value='Test JSA 1'." Got any ideas why that is? The only thing I can think of is that this is happening because the form (and body) is contained within a php file included in the header file. Any help you can give will be very much appreciated.
  7. Get element.style.top(left) value

    Hello, Recently i faced a problem which seems very odd to me and I would like to find the answer or at least acceptable explanation. But let's go straight to it. Let's have two divs one inside the other - the code is something like: <div id="imgframe"> <div id="innercont" class="dragme"> <a class="marker" style="left: 1060px; top:658px;" onclick="movepos(1060, 658)"></a> </div></div><button type="button" onclick="displayattr()">Test</button> they are styled with css like this: #imgframe { width: 950px; height: 600px; overflow: hidden;}#innercont { width: 1994px; height: 1144px; position: relative; left: -600px; top: -300px;} And with javascript I am trying to find the top and left values of the #innercont. I have written the following functions: function getx() { var bg = document.getElementById("innercont"); var xs = bg.style.left; var x = Number(xs.replace("px","")); return x;}function gety() { var bg = document.getElementById("innercont"); var ys = bg.style.top; var y = Number(ys.replace("px","")); return y;}function displayattr() { var sum = getx() + ", " + gety(); alert(sum);} Everything so far seems fine, but when I use displayattr() just after the page has been loaded it returns 0, 0. The code works fine when I use javascript to set the position of the #innercont: function reset() { var bg = document.getElementById("innercont"); bg.style.left="-600px"; bg.style.top="-300px";} They say that element.style.top sets or returns the top position of a positioned element, but it appears that it is not the same if we set the position by using css or javascript. So far I have managed to solve the problem by using "getComputedStyle" or adding onload="reset()" to the body tag but I don't want to use either since they mess my code later. If anyone has an explanation why does it happen so I'll be very grateful. Thanks in advance.
  8. New to Javascript. I am trying to show the selected value after the change so I can do some additional processing, but I cannot get my code to run. I am not sure my syntax is correct using java script.? <html> <head> <title>This is my test site</title> <script> function test(value) { value = document.getElementById("colorOption").selectedIndex; alert("document.getElementById("colorOption")[x].value); } </script> </head> <select id = "colorOption" name "colorOption" onchange = "test(value)"> <option value = 0>Red</option> <option value = 1>Green</option> <option value = 2>Blue</option> <option value = 3>Yellow</option> <option value = 4>Purple</option> </select>     </body> </html>
  9. Looping array (get key and value)

    I need to loop through an array, in the order that the items appear, and get both the key of the item and its value. I know I can use foreach to loop through an array but as far as I know I can choose between the key and the value of the current item but not get both. Here's an example of an array: <?php$SampleArray = array(55 => "car","2" => "house","boat" => "boat",0 => "engine",666 => "website",);?> It would work somehow like this: loop($SampleArray){ echo key . " - " value . "n";} And the result would be something like:55 - car 2 - house boat - boat 0 - engine 666 - website
  10. Hi! I'm new to the whole form-making business and currently beating my way though the basics. Right now i'm clueless about what seems to be a pretty simple and straightforward function. I want my visitor to be able to add values from two different <input-type>-fields into a <textarea>. These two values (being name and e-mail) should become a single row in the <textarea>. The visitor should also be able to remove desired generated rows with a simple click on the "remove selected"-button. The result should look like this: This part of my form looks like this thus far: <div class="deltagare-rubrik">Namn:</div> <input type="text" size="45" name="deltagare-namn" value""> <div class="deltagare-rubrik">E-post:</div> <input type="text" size="45" name="deltagare-epost" value""> <br /> <input type="button" name="deltagare-add" value="Add" class="button"> <br /> <textarea name="deltagare-list" class="deltagare-list" readonly="true"></textarea> <input type="button" name="deltagare-remove" value="Remove selected" class="button"> Very grateful for help, thanks!
  11. i'm trying to send information to the following page but can't seem to do so. this might be a html problem i build an if (isset($_REQUEST[""])) to have one side link and another form. problem is that for the image link i set up, i can't send value to the following page <?phpif (isset ($_REQUEST['code']))$code=$_REQUEST['code'];$phone=$_REQUEST['phone'];?> <html><head><title></title></head><body> <?php if (isset($_REQUEST['code'])) echo "</br> <a href=\"request.php\?code&&phone"><img src=\"../images/button1.png\" onmouseover=\"this.src=\'../images/button1-hover.png\'\" onmouseout=\"this.src=\'../images/button1.png\'\"/></a>"; else echo "form"?> </body></html> I thought all i have to do is add ?code&&phone to the <a href> tag.. what am i doing wrong Please help. Thank you
  12. I'd like to hide the corresponding button when an input value is empty or has a value="n/a". In the following example, the input box "first_field" is corresponding with the button "first_button", and the input box "second_field" with the button "second_button", and so on... In this case the second and fifth button will be hidden: <!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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Hide Button When Input Value Is Empty</title></head><body> <div> <form action=""> <fieldset> <input type="text" id="first_field" value="1"/> <input type="text" id="second_field" value=""/> <input type="text" id="third_field" value="3"/> <input type="text" id="fourth_field" value="4"/> <input type="text" id="fifth_field" value="n/a"/> <input type="text" id="sixth_field" value="5"/> </fieldset> </form> </div> <div> <form action=""> <fieldset> <div id="first_button"><input type="button" value="First Button"/></div> <div id="second_button"><input type="button" value="Second Button"/></div> <div id="third_button"><input type="button" value="Third Button"/></div> <div id="fourth_button"><input type="button" value="Fourth Button"/></div> <div id="fifth_button"><input type="button" value="Fifth Button"/></div> <div id="sixth_button"><input type="button" value="Sixth Button"/></div> </fieldset> </form> </div></body></html> Anyone know a Javascript that can do this?
  13. "museo-slab-1" What is this?

    Hello, So I am fairly new to the developer world and I am dong this on my own (self taught). I have a friend who sent me a template design of something to put together, he also sent me the CSS and HTML code so i code use it in reference if I was stuck... I noticed in the CSS there is a lot of reference for value "museo-slab1" under then font property. What is this? Is this a type of font? I hope this question is clear enough to understand. being fairly new it is hard for me to know the right question to ask. Any help would be appreciated. Thanks Here is one of the lines of CSS that I found it in, hopefully this helps... font:normal normal 500 11px/21px "museo-slab-1","museo-slab-2",serif;
  14. I have a div animated by incremented margin-left when the user clicks a button. I would like to force the animation to stop at a specific margin-left value and callback a different animation. So if the user tries to click too far it prevents them from doing so. Suggestions? I'd like to do it with margin because it'd be easier to edit later, but if I have to use .position.left as a variable, I'll take the code for that just as well. Here's a wacky selector I tried, to no avail, if it helps convey my intention: $('.slidingDiv[style*=margin-left:80px]').stop().animate(.....); I didn't bind it to a .click because I want to be able to stop any-size div at any given point rather than map it out explicitly. Thanks!
  15. How Do I Get The Value Of A Button Using Php

    I have many buttons (not radio or checkbox but just simple buttons) on my page where the values were populated by an "onclick" command. How do I get PHP to process all that data and list it out.
  16. I have a Javascript that retrieves the text from between the "p" tags and put it in the title value, like this: before:<option title="" value="Put Text">Put Text</option> after:<option title="$1,179.83" value="Put Text">Put Text</option> The only problem is, it doesn't work in ie6-8. Does anyone know how to make this code work in ie6-8? <!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"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Get text and put in attribute value</title></head> <body> <div class="Text"><p>$1,179.83</p></div> <form action=""> <fieldset> <select class="putText" name="put-Text"> <option id="" class="putTextOption" value="Put Text">Put Text</option> </select> </fieldset> </form> <script>window.onload=function() { var pTag = document.getElementsByClassName("Text")[0].getElementsByTagName("p")[0]; var amount = pTag.innerHTML; document.getElementsByClassName("putTextOption")[0].title=amount;} </script> </body></html>
  17. Hi I'm trying to build a Link Generator (just for practice) and am trying to add the option to specify whether it is underlined (using style attribute). However, it no longer works at all. Can someone help? Link: http://dl.dropbox.co...Untitled-3.html Relevant Code: <head><script>/*Functions*/function editLink(){var lText= document.getElementById('linkText');var lURL= document.getElementById('linkURL');var lUL= lUL_value();var taValue= document.getElementById('taHTMLoutput');function lUL_value(){var a=document.form1.uLine;if ('a==yes'){return "style=\"text-decoration:underline;\"";}else{return "style=\"text-decoration:none;\"";};}function changeHTML(){return "<a href=\"" + lURL.value + "\" " + lUL.value + ">" + lText.value + "</a>";};taValue.value= changeHTML();document.getElementById('outputP').innerHTML = "<a href=\"" + lURL.value + "\" " + lUL + ">" + lText.value + "</a>";}function select_content(elementID) { // first set focus document.getElementById([elementID]).focus(); // select all contents document.getElementById([elementID]).select(); }function writepageTitle(){// not workingvar pgTitle= document.getElementById('title');document.getElementById('footerpageTitle').innerHTML = pgTitle.innerHTML;}/*Other*/window.onload = 'writepageTitle';// ^^ not working ^^ //</script></head> <body><div id="uberContainer"><header>...</header><div id="mainContainer"><table align="center"><tr><td><form id="form1" onsubmit="return false;" style="border:1; border:#666"><legend><h3>Link Details</h3></legend><div id="formContainer"><table><tr><td><label for="linkText">Link Text</label></td><td><input class="inputRight" id="linkText" autofocus="autofocus" placeholder="Mel Jones Photography Ltd." required size="40" type="text" autocomplete="on" /></td></tr><br /><tr><td><label for="linkURL">Link URL</label></td><td><input type="url" required class="inputRight" id="linkURL" placeholder="http://meljones.info/" autocomplete="on" size="40" /></td></tr><tr><td><label for="uLine">Underline</label></td><td><input id="uLine_yes" type="radio" name="uLine" value="yes" /> Yes <input id="uLine_no" type="radio" name="uLine" value="no" /> No<br /></td></tr><tr><td></td><td><button onclick="editLink();">Amend Link!</button></tr></table></div></form></td><td><table><tr><td><h3>Output: </h3></td><td><p id="outputP"></p></td></tr><tr><td>HTML:</td><td><form id="formHTMLoutput"><textarea onClick="select_content('taHTMLoutput');" value="" id="taHTMLoutput"readonly placeholder="The HTML code for the Link will appear here!"></textarea></form></td></tr></table></td></tr></table></div><footer>...</footer></div></body></html> Full Code: <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title id="title">Element Express.: Link Maker!</title><style>/* element styling *//* */a{color:#F28705;text-decoration:none;}a:visited{color:#BF3604;}body{font:Tahoma, Geneva, sans-serif;font-family:Tahoma, Geneva, sans-serif;background-color:#324452;color:#cccccc;}textarea{max-width:600px;min-width:350px;min-height:100px;}table{vertical-align:text-top;}hr{ }input{vertical-align:text-top;}/* element id styling *//* */div#uberContainer{max-width:75%;margin-left:auto;margin-right:auto;left:50%;outline:solid;outline-color:#97BDBF;min-height:100%;}nav#mainNav{vertical-align:top;right: 10%;}/* classes *//* */.inputRight{margin-left:auto;left:100%;}.class1{color:#97BDBF;}</style><script>/*Functions*/function editLink(){var lText= document.getElementById('linkText');var lURL= document.getElementById('linkURL');var lUL= lUL_value();var taValue= document.getElementById('taHTMLoutput');function lUL_value(){var a=document.form1.uLine;if ('a==yes'){return "style=\"text-decoration:underline;\"";}else{return "style=\"text-decoration:none;\"";};}function changeHTML(){return "<a href=\"" + lURL.value + "\" " + lUL.value + ">" + lText.value + "</a>";};taValue.value= changeHTML();document.getElementById('outputP').innerHTML = "<a href=\"" + lURL.value + "\" " + lUL + ">" + lText.value + "</a>";}function select_content(elementID) { // first set focus document.getElementById([elementID]).focus(); // select all contents document.getElementById([elementID]).select(); }function writepageTitle(){// not workingvar pgTitle= document.getElementById('title');document.getElementById('footerpageTitle').innerHTML = pgTitle.innerHTML;}/*Other*/window.onload = 'writepageTitle';// ^^ not working ^^ //</script></head> <body><div id="uberContainer"><header><table id="table_deleteID" width="100%"><tbody><tr><td><h1>Welcome!</h1></td><td width="50%" align="right"><nav id="mainNav"><a href="">Home</a> | <div id="elementsnavContainer"><a onmouseover="">Show stuff on mouse over!</a><br><div id="elementsnavDropdown">Hey</div></div></nav></td></tr></tbody></table><div id="mydiv2" style="cursor:crosshair"></div><hr class="class1" /></header><div id="mainContainer"><table align="center"><tr><td><form id="form1" onsubmit="return false;" style="border:1; border:#666"><legend><h3>Link Details</h3></legend><div id="formContainer"><table><tr><td><label for="linkText">Link Text</label></td><td><input class="inputRight" id="linkText" autofocus="autofocus" placeholder="Mel Jones Photography Ltd." required size="40" type="text" autocomplete="on" /></td></tr><br /><tr><td><label for="linkURL">Link URL</label></td><td><input type="url" required class="inputRight" id="linkURL" placeholder="http://meljones.info/" autocomplete="on" size="40" /></td></tr><tr><td><label for="uLine">Underline</label></td><td><input id="uLine_yes" type="radio" name="uLine" value="yes" /> Yes <input id="uLine_no" type="radio" name="uLine" value="no" /> No<br /></td></tr><tr><td></td><td><button onclick="editLink();">Amend Link!</button></tr></table></div></form></td><td><table><tr><td><h3>Output: </h3></td><td><p id="outputP"></p></td></tr><tr><td>HTML:</td><td><form id="formHTMLoutput"><textarea onClick="select_content('taHTMLoutput');" value="" id="taHTMLoutput"readonly placeholder="The HTML code for the Link will appear here!"></textarea></form></td></tr></table></td></tr></table></div><footer><hr><table width="100%"><tbody><tr><td align="center" width="33%"><a href="http://www.meljones.info/">Mel Jones Photography Ltd.</a></td><td align="center" width="34%">© Daniel Carl 2011</td><td align="center" width="33%"><p id="footerpageTitle"></p></td></tr></tbody></table></footer></div></body></html>
×