The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> drop down menu
tudsy
post Aug 15 2016, 07:41 PM
Post #1


Advanced Member
****

Group: Members
Posts: 248
Joined: 30-September 14
Member No.: 21,611



)Hi

I am still having problems in trying to come up with a drop down menu. I have attached the full code and the resulting output (screenshot).

The main problem is that I am not generating the options in the drop down menu. Can anyone help?


Thanks.


Attached thumbnail(s)
Attached Image

Attached File(s)
Attached File  code.txt ( 5.36k ) Number of downloads: 1560
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
tudsy
post Sep 19 2016, 09:40 PM
Post #2


Advanced Member
****

Group: Members
Posts: 248
Joined: 30-September 14
Member No.: 21,611



Hi

Thanks for that.

After some manipulation, I am trying to return the selectedgraphicfilename (graphic that people buy) to pass through the query string when the user presses buy.

But I am not getting anything from the functions changePic and for that matter, linkSound.

Also, the variable Priceofart is nothing in the query string.


Can anyone help?

Here is the code:


<!DOCTYPE html>

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">


<script>

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-908952-3', 'auto');
ga('send', 'pageview');
ga('require','linkid');
</script>






<script>



var personsnamejs ='AdrianTudini';

var personpicture = personsnamejs + '.jpg';

var Priceofart = 2;

function setVar(){

var personpath = 'http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/' + personsnamejs + '/' + personpicture;

document.getElementById('Price').innerHTML= 'Price of Art ( without a watermark )(USD): $' + Priceofart;

var x = document.getElementById('Title');
x.style.color = '#00FF00';
x.style.fontSize ='36px';

document.getElementById('PersonImage').src = personpath;

var y = document.getElementById('Price');
y.style.color = '#00FF00';
y.style.fontSize ='36px';

var z = document.getElementById('PlaySound');
z.style.color = '#00FF00';
z.style.fontSize ='24px';

var t = document.getElementById('paypal');
t.style.color = '#00FF00';
t.style.fontSize ='24px';

var u = document.getElementById('freename');
u.style.color = '#00FF00';
u.style.fontSize ='20px';

var v = document.getElementById('freeaddress');
v.style.color = '#00FF00';
v.style.fontSize ='20px';


document.getElementById('def').innerHTML = 'Click-Tap dropdown menu to view/select ' + personsnamejs + ' 's Art';




};
</script>


<script type='text/javascript'>

function linkSound(picname,personname)
{

if(picname != 'default')
{

var soundfile = picname.replace('w.bmp','.mp3');





var soundfilepath = 'http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/' + personname + '/Sound/' + soundfile;



return soundfilepath;



}


};</script>


<script>

function changePic(picname,personname)
{

if(picname != 'default')
{


var path = 'http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/' + personname + '/Graphicw/' + picname;

var myimg = document.getElementById('myImage');


var selectedgraphicfilename = picname.replace('w.bmp','.bmp');


var newImage = new Image();
newImage.src = path;



newImage.onerror = function()
{
alert('There was a problem loading the Image file! - Please try again');
myimg.style.height = '';
myimg.src = '';
}
newImage.onload = function()
{
myimg.src = path;

}
return selectedgraphicfilename;
}

};

</script>





<title>ECOVIB2D&copy;</title>
</head>
<body onload='setVar();' style='background-color: #660000'>








<table align='centre' border='0' width='965'>
<tbody>
<tr>
<td bgcolor='#660000' width='189px'><img height='90' src='http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/ecovib2d1.jpg' width='90' /></td>
<td bgcolor='#660000' width='500px'>
<p align='center' id ='Title'>ECOVIB2D&copy;</p>
</td>
</tr>
</tbody>
</table>





<table align='center' style=' background-color: #660000'>
<tbody>


<br>


<tr>

<center> <p id='Price'> </p></center>


<td align='left'>


<img src= 'personpath' id='PersonImage' width='450' height='450'>


</td>


<td align='top'>

<script> alert(personsnamejs)</script>


<select name='Graphic_select' id='Graphic_select' onchange='changePic(this.value,personsnamejs);linkSound(this.value,personsnamejs);'/>





<option value ='default' id = 'def' style='height:120px;'></option>


<?php

$pname = "AdrianTudini";

foreach(glob("/home/ecovibdc/public_html/ECOVIB2D/MYART/".$pname."/Graphicw/*.bmp") as $files1){

$files1 = basename($files1);


echo "<option value='{$files1}'>{$files1}</option>";
}

?>

</select>




<img id='myImage' src='' height='450' width='450'>

<p align='center' id='PlaySound' >Play the sound with my art in mind</p>


<center><audio id='audiotag1' controls='controls'><source='soundfilepath' type='audio/mpeg'>You cannot play the sound in browser.</audio></center>

</td>
</tr>
</table>

<script>alert(selectedgraphicfilename);</script>

<form action='http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/process.php?Price=Priceofart&Graphic=selectedgraphicfilename' method='POST'>

<p align='center' id='freename'>Enter Full Name:</p>

<p align='center'><input id='Nameofperson' maxlength='50' name=username size='50' type='text' /></p>

<p align='center' id='freeaddress'>Enter Email-Address:</p>

<p align='center'><input id='e-address' maxlength='50' name=email size='50' type='text' /></p>

<p align='center'><input type='submit'style='height:65px;width:220px;font-size:36px' value='Buy*' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='reset'style='height:65px;width:220px;font-size:36px;' value='Clear' /></p>
</form>

<p align='center' id='paypal'>* You will be requested by email to pay by Paypal&copy;. Your name and email address will not be sold or traded</p>

<p align='center' class='style8'><a href='http://ecovib2d.blogspot.com.au'>Back to Ecovib2d's blog</a></p>


<p align='center'><span class='style8'><a href='mailto:tudsy@ecovib2d.com.au'>Send me Mail</a></span></p>









</body>
</html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
tudsy   drop down menu   Aug 15 2016, 07:41 PM
CharlesEF   I have no idea what are valid values for $pna...   Aug 17 2016, 12:05 AM
tudsy   Hi Thanks for that. Graphicw has permissions se...   Aug 17 2016, 12:52 AM
CharlesEF   So, does that mean the problem was permissions? O...   Aug 17 2016, 02:43 PM
tudsy   Hi I am having the same problem but I put the url...   Aug 18 2016, 05:56 AM
CharlesEF   Sorry to hear that. I looked over your code but I...   Aug 18 2016, 08:54 AM
tudsy   Hi I used glob() and it works!. It creates th...   Aug 20 2016, 11:51 AM
CharlesEF   I think what you need to do is this. The <sele...   Aug 20 2016, 09:37 PM
CharlesEF   Maybe, since you are not uploading an image to the...   Aug 21 2016, 05:20 AM
Christian J   Maybe, since you are not uploading an image to th...   Aug 21 2016, 04:17 PM
tudsy   Hi My problem is now using JS to update the image...   Aug 30 2016, 10:43 PM
CharlesEF   This is just an outline of what needs to be done. ...   Sep 1 2016, 01:24 AM
tudsy   Hi again I have adopted the changes from the l...   Sep 5 2016, 12:01 AM
Christian J   I have adopted the changes from the last post ...   Sep 5 2016, 06:52 AM
CharlesEF   Christian J has already pointed out some problems....   Sep 5 2016, 09:09 AM
CharlesEF   I forgot to say that the code I posted is not test...   Sep 5 2016, 12:13 PM
tudsy   Hi I got it to work by putting the absolute path...   Sep 6 2016, 07:29 AM
CharlesEF   Hi I got it to work by putting the absolute pat...   Sep 6 2016, 01:16 PM
tudsy   Hi The path was the only problem.   Sep 9 2016, 02:52 AM
tudsy   Hi I was wondering. Can I use the same type of co...   Sep 9 2016, 02:58 AM
CharlesEF   When using the audio tag, there was a time when IE...   Sep 9 2016, 10:18 AM
CharlesEF   BTW, you never answered my question. Why do you i...   Sep 9 2016, 01:46 PM
tudsy   BTW, you never answered my question. Why do you ...   Sep 10 2016, 11:46 PM
CharlesEF   [quote name='CharlesEF' post='130221' date='Sep 1...   Sep 11 2016, 06:52 AM
tudsy   [quote name='CharlesEF' post='130221' date='Sep ...   Sep 13 2016, 11:13 AM
CharlesEF   Does the page have a .php extension? Have you loo...   Sep 13 2016, 11:57 AM
tudsy   Hi Thanks for that. I m trying to let the user ...   Sep 16 2016, 12:03 AM
CharlesEF   I'm not sure where you came up with 'click...   Sep 16 2016, 08:50 AM
tudsy   Hi I am still having problems with the 'sound...   Sep 19 2016, 12:33 PM
CharlesEF   I've never used javascript's Audio command...   Sep 19 2016, 04:56 PM
tudsy   Hi Thanks for that. After some manipulation, I a...   Sep 19 2016, 09:40 PM
CharlesEF   This line of code is wrong: document.getElementByI...   Sep 20 2016, 09:25 AM
tudsy   Hi again Thanks for that. I have got the image w...   Sep 21 2016, 04:14 AM
CharlesEF   This line of code is still wrong: <img src= pe...   Sep 21 2016, 05:53 AM
tudsy   Hi Thanks for that. I got the sound working with...   Sep 21 2016, 06:19 AM
CharlesEF   Great news, glad you got it working.   Sep 21 2016, 06:42 AM
tudsy   Hi I was wondering how do I pass JavaScript varia...   Sep 21 2016, 07:21 AM
CharlesEF   Hi I was wondering how do I pass JavaScript varia...   Sep 21 2016, 01:07 PM
Christian J   New post moved to its own thread: Drop down menu...   Jun 14 2022, 04:38 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th September 2024 - 08:47 AM