PC Building Form
Dec 22, 2005
I'm trying to build a PC building form using drop-down menus. I want to use the values of each option in the menu and add them together to get the total price, then display the total price somewhere on the page.
View 4 Replies
ADVERTISEMENT
May 28, 2007
I have a flash file that calls this JS function. It basically adds a number to a comma separated string. this works fine.
var select = "";
function selectCounty (cid){ select = cid + "," + select; }
The flash also calls this function to remove a value from the string. The removeVal() function works. though, the *select* variable is not reforming into a string. I'm missing how to then put the array into a form that this is part of.
function unSelectCounty (cid){
// split the *select* string into an array
var select_array = select.split(/,/);
// remove *cid* value from array
unselect = removeVal(select_array, cid);
// reset *select* var
select = "";
for (i=0;i<unselect.length;i++){ if (unselect[i] != ''){ select = unselect[i] + "," + select; } }
}
function removeVal(arr, valToRemove){
// Normalize to a string like !val!!val!!val!
var s = '!' + arr.join('!!') + '!'
// Remove targeted values with delimiters
s = s.replace(new RegExp('!' + valToRemove + '!', 'g'), '');
// Remove delimiter added to end in step 1
s = s.replace(/^!/, '');
// Remove delimiter added to start in step 1
s = s.replace(/!$/, '');
// Convert to array
return s.split('!!');
}
Please help with these two problems-
1) i cant get the *select* string in unSelectCounty() to reform correctly.
2) i am unsure what to write so that the value of *select* is passed in POST form array. it can accept it either as an array or a string.
View 1 Replies
View Related
Mar 29, 2006
I'm trying to combine some javascript variables into a URL, so I can pass the screen resolution to PHP to determine how large a popup window should be.
What I want to end up with is something like:
<a href="url.php?w=1024&h=768">Click me</a>
I'm trying this (which ain't workin'):
<a href="url.php?w=<script language=javascript>document.write screen.width;</script>&h=<script language=javascript>document.write screen.height;</script>">Click me</a>
It's just writing the literal script to the URL, not the value of the width or height.
View 2 Replies
View Related
May 10, 2011
I'm still working on same task New problem: When I place text in a rectangle, then wish to overwrite it,(that is replace it with new test,) I cannot remove the earlier text. The new overlays the old, an unreadable mess.
Moreover, what I have achieved works only in Opera. FF tells me I have too much recursion (None that I'm aware of). I cannot get any feedback from IE.
[Code]...
View 2 Replies
View Related
Oct 4, 2006
I have a form that has two radio buttons. When the first one is
clicked, I would like the page to refresh (keeping the form data in
tact) and then displaying 2 new fields that need to be filled out. If
the second button is clicked, I need the same thing to happen, only it
will display two different fields needing to be filled out.
Does anyone have code that will do this? Or is this even possible with
JavaScript?
View 10 Replies
View Related
Jul 20, 2005
OK, I am looking for advice or tips and suggestions. I have overcome
a lot of the obstructions I had to building the page design my
customer was asking for. I am looking now at ways to deliver content
dynamically within the wonderful framework I created. Whilest I look
into the various methods of delivering content within a container of
one form or another in the existing HTML, I am also exploring the
possibility of using some form of 'wrapper' for existing flat pages
sorta like how geocities does to user pages to add the yahoo pull-down
div layers and such.
While doing some testing, I notice that if I just add a javascript tag
in the beginning, I can't use the document.body.AppendChild option for
the div layers unless I call the function that builds said layers from
a <body onload="">. When I do it from the onload event, the existing
HTML layers can effect the placement of the div layers even when I
have the CSS position set to absolute.
Short of using some form of server side code to insert at least the
DIV content in prior to dropping the file on the user's browsers, I
was wondering if there were any other suggestions on how to do this
with a minimal amount of coding in the HTML document itself. One of
my hopes is to limit the 'modifications' to any standard HTML file to
one or two lines so that anyone else developing pages can do so
easily, and/or I can create reasonably foolproof server-side wrappers
to call the javascript code to paste on the 'look-and-feel' elements
on just about any web page.
I have a feeling I will probably go the server-side route anyway, but
I was just curious what other suggestions there might be out there.
View 1 Replies
View Related
Jul 14, 2010
I want to do this with a checkbox and am falling down on it...
Code:
var i=0, elem, qstr='';
while(elem=document.forms['form1']['quantity'+(++i)]){
qstr += (qstr.length ? '&' : '?') + 'quantity' + i + '=' + elem.options[elem.selectedIndex].value;
}
Here is the checkbox
Code:
<input type="checkbox" name="approved[]" onclick="boxchk(this,6)" checked="checked" value="'".$j['id']."'"/>
View 1 Replies
View Related
Jul 8, 2009
I am very new to web development. I would like my website to have an application which allows a user to draw images which can be displayed on other users screens in real time.
An example of this is isketch.net Also on this site i would like users to be able to create accounts and join 'rooms' where they can communicate in real time (as opposed a forum message board). I am looking for something similar to isketch.net
Could somebody please tell me the type of development and programming needed. I have been quoted 1000 a month to build these capabilities but have no idea what is involved. (also may require facebook style real-time updating)
View 4 Replies
View Related
Jun 1, 2011
I am trying to build my first script. My problem, is I'm trying to build a multi hide/show script, displaying paragraphs of information. If I want multiple variables for the script do I have to use an array? and if so, how can I construct this array?
Here is my script as of now,
<!--
// this tells jquery to run the function below once the DOM is read
$(document).ready(function() {
[code]....
Right now the script doesn't work with the bottom two variables profile_"ect."
View 1 Replies
View Related
Mar 14, 2003
I'm fooling around with building a form that grows depending on the users input (relatively new to DOM 2 - but fun stuff!) I'm working on getting it to work (rather than being pretty - there are many improvements that could be made).
My question is has anyone seen any similar examples out there? The more I build on this thing, the more I believe there has to be another way... (like rather than creating every pull-down box - yes, I should put that into it's own function! - should I be playing with visibility and positioning?) Code:
View 1 Replies
View Related
Dec 12, 2005
I've got a URL in an include file like this :
<iframe src=http://www.blah.com?query=thevariable>
I want to be able to set 'thevariable' in the shtml page that calls that include and pass it to that string - I'm thinking that because I don't want to use php/asp that Javascript is the best way?
In PHP I'd do it like this :
<iframe src=http://www.blah.com?query=<?echo $thevariable;?>>
So how do I echo/insert the variable in the URL using javascript rather than PHP?
View 3 Replies
View Related
Sep 20, 2011
I'm building a web site ala autos.yahoo.com on servicos.mpl.pt/comparador/css1.php I have a sidebar with filtering options grouped in an accordion. The accordion panels get populated via jquery like:
Code:
//getMarcas
$(function() {
//get tag feed
[Code]...
View 3 Replies
View Related
Aug 16, 2010
point out where my logic is flawed in this? Or where my scripting is wrong?I'm trying to build a standard HTML table with 5 columns across and as many rows down as necessary, to fit all of the images in an array (brought into the DOM via PHP).My goal is to have rows of 5 columns that add on to accomodate up to 50 total images (10 rows).Here's my logic (flawed or not):*Look at the number of tems in the array*If the number is greater than 5, build one full row (of 5 <td>s)*Check again - is the number of items in the array greater than 10?*Build another row*If not, build a partial row, and fill in the rest of the <td>s (less than a full row) with blank spaces.The question is whether or not my logic is being represented in the javascript?unctions in <head>calls to function on lines 149-159Don't mind the formatting, I've blown it up so I can see what's going on.
View 4 Replies
View Related
Sep 8, 2010
I want to construct HTML for a menu and I want to use DIV with UL. The data for the link and text would be coming from a web service which is a sharepoint list like so. As you can see below I want to grab the rows and and it to anchor links...
$(document).ready(function() {
$().SPServices({
operation: "GetListItems",
async: false,
listName: "MenuList",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).find("[nodeName=z:row]").each(function() {
var liHtml = $(this).attr("ows_Title") ; $("#mainmenu").append(liHtml);
});
}});
});
The desired HTML would look like so
<div id="mainmenu">
<div id="header">
<ul id="navbar">
<li class="menu"><a href="#">Home</a>
<ul>
<li><a href="#">liHtml </a></li>
<!--I want to keep adding the <li> element with new item-->
<li><a href="#">Menu item 2</a></li>
<li><a href="#">Menu item 3</a></li>
<li><a href="#">Menu item 4</a></li>
<li><a href="#">Menu item 5</a></li>
</ul></li>
</ul></div>
</div>
View 1 Replies
View Related
Aug 7, 2011
I am trying to build a webapp for questionnaires where I can defined the questions in json, and have a single html page using jquery to build the UI. Since there will be a finite number of question types, e.g free text questions, multiple choice questions my code can choose how to render each type appropriately.
what is considered the best approach to build a UI like this?
I have seen the manipulation api with methods such as append() but I'm not sure if appending the html tags via strings (e.g. "<input id='answer'/>") is going to be the best way to achieve this, or whether there is a better way to define snippets of html for the different question types and copy them into the page as necessary?
View 5 Replies
View Related
Feb 28, 2009
I have a facebook game that I would like to create an autoroller for. What the game does is you get a base login and you click an object and you collect common, semi rare, and rares. I want the autoroller to take whatever money the user puts in a field and start rolling for those prizes. To give you an example [URL]. I have 3 scripts written already, 1 in html and 2 in java, but I don't know how to execute them.
View 1 Replies
View Related
Aug 18, 2009
I am building a store locator for a website that I maintain; I am using a G! example
[url]
However, there seems to be some issues that I can't find... I have looked until I go blind...
This is the php code that I am using:
View 5 Replies
View Related
May 1, 2010
I have an array but I'm not exactly sure how to finish the build using an if statement. I have 6 elements and need the build to load a different top image for each array that loads that matches the specific element. Here is what I have but it only shows the first top image no matter what:
<LINK REL=StyleSheet HREF="scrolling_popup/scrolling_popup.css" TYPE="text/css">
<script type="text/javascript" language="javascript" src="scrolling_popup/scrolling_popup.js"></script>
<script type="text/javascript" >
var array = new Array();
array[0]='<a href="[URL]" target="_blank"><img src="[URL]" border="0" alt=""></a>';
array[1]='<a href="[URL]" target="_blank"><img src="[URL]" border="0" alt=""></a>'; .....
View 1 Replies
View Related
Oct 12, 2010
I have an issue building a query string. Basically, I have this:
/sites?order=site_numper_page=20&
But I would like to convert it to this:
/sites?order=site_num&per_page=20
I have tried this to check if the current iterator is less than the length of the object and if so, then add the "&", otherwise, don't. But it doesn't seem to work:
$.each(query_string, function(key,value){
params += key + '=' + value;
if((value + 1) != query_string.length){
params += "&";
}})
View 1 Replies
View Related
Jul 5, 2011
I have a website which displays routes on a map. The data behind this is held in a MySQL database. What I want to do is to be able to click a button and the current route information would be download in a gpx file (xml variant) for that route, built from the database. I'm using shtml, Javascript and perl. Is it possible? The formatting of the data is not an issue. I am a real novice and have self taught enough to get where the site is today, so please be gentle.
View 2 Replies
View Related
Aug 6, 2009
I have a project on building a horizontal slide show and it has to look like this site. tiltdesignstudio [dot]com and instead of flash, i need to use other programming language.
1) is it possible to create a site like that with out using flash?
2)What would be the best approach to build this project?
View 5 Replies
View Related
Dec 8, 2011
How do I keep the red divs from building up (one under another) with each onclick event? I tested variations of removeChild(div) without success. Is removeChild(div) part of the answer and I'm just using it wrong or is there a better approach?
HTML Code:
<html>
<head>
<script type="text/javascript">
function showHint(str) {
if (str.length==0) {
document.getElementById("txtHint").innerHTML="";
[Code]...
View 7 Replies
View Related
Jan 4, 2010
i was building a website using two jquery codesfirst one for the slideshow banner and the other one for the menu but only one of them works, i've search on the web and i fouond something called jquery no conflict()is this good?this is the code inside de <head> tags
<!-- JavaScripts-->
<script type="text/javascript">
jQuery.noConflict();
[code].....
View 1 Replies
View Related
Apr 26, 2009
I am working on some web projects that make use of still frame images that are put together to create animations. These animations are then used as building blocks to create an interactive application, I am hoping to get input on a current project that was just completed by a javascript programmer I am working with.
I am looking for ways to make development of these types of applications more efficient in the future, I am considering using jquery or some other framework. I am very interested to hear anyone's input on this. Something I have been thinking of is making a "code repository" of sorts where snippets of code are saved for use in future projects that may require similar effects.[URL]..
View 5 Replies
View Related
Apr 1, 2010
I have several <img> lines in my markup that contain an onmouseover attribute, as shown below: <img id="flowersPic" class="queue" class="queue" src="media/flowers.jpg" onmouseover="playVideo('flowers.flv'); "/> . .<img id="animalsPic" class="queue" src="media/animals.jpg" onmouseover="playVideo('animals.flv'); "/> . .<img id="waterPic" class="queue" src="media/water.jpg" onmouseover="playVideo('water.flv');"/> . .</body>I want to use jQuery to build a standard JavaScript array of just the video names in the onmouseover attribute. So for the markup above the array would be the stringsflowers.flvanimals.flvwater.flvI expect the jQuery will be something likev=$(img.queue).??????.get();but I'm really not sure what should go in the ?????? area.
View 12 Replies
View Related
Nov 29, 2011
i m in deep trouble in implementing Tree control .. which will be having data from 'mysql' database.
View 1 Replies
View Related