/    Sign up×
Community /Pin to ProfileBookmark

i am trying to put a css in a form. bit when i do is stop functioning, it does not work, the form does not work, i am tying to put this css in this form

<link href=”css.css” rel=”stylesheet” type=”text/css”/>


********************************************

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<script type=”text/javascript”>

var dogPhoto = “”;

function displayPhoto(nPhoto){

if (nPhoto == “”){return}
var currPhoto = nPhoto;
if (dogPhoto != “”){dogPhoto.close()}
dogPhoto = window.open(”,”,’toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=290,left = 262,top = 134′);
dogPhoto.document.open();
var imgStr = “<img src=”+currPhoto+”>”
dogPhoto.document.write(imgStr);
dogPhoto.document.write(“<br><input type=’button’ value=’Close’ onclick=’self.close()’>”);

}

var dogs = [];
dogs[0] = [‘s’,’s’,’l’,false,’bully.jpg’,’Bully’];
dogs[1] = [‘s’,’s’,’h’,true,’rex.jpg’,’Rex’];
dogs[2] = [‘s’,’l’,’l’,true,’daisy.jpg’,’Daisy’];
dogs[3] = [‘m’,’s’,’h’,true,’dot.jpg’,’Dot’]; // same as liquorice
dogs[4] = [‘l’,’l’,’l’,true,’sam.jpg’,’Sam’];
dogs[5] = [‘l’,’s’,’h’,true,’pip.jpg’,’Pip’];
dogs[6] = [‘s’,’l’,’l’,false,’cyril.jpg’,’Cyril’];
dogs[7] = [‘l’,’s’,’l’,true,’bones.jpg’,’Bones’];
dogs[8] = [‘m’,’s’,’h’,true,’liquorice.jpg’,’Liquorice’]; //same as dot
dogs[9] = [‘l’,’s’,’h’,false,’fang.jpg’,’Fang’];

function buildList(nName,nPhoto){

var nOption = document.createElement(‘option’);
var isData = document.createTextNode(nName);
nOption.setAttribute(‘value’,nPhoto);
nOption.appendChild(isData);
document.forms[1][‘matched’].appendChild(nOption);
}

function chooseDog(nForm){

if (dogPhoto != “”){dogPhoto.close()}
document.forms[1][‘matched’].options.length = 1;

var nSize = nForm[‘size’].value;
var nCoat = nForm[‘coat’].value;
var nEnergy = nForm[‘energy’].value;

if (nSize == “” || nCoat == “” || nEnergy == “”)
{alert(‘Select from all lists’); return}

var nChild = false;
if (document.getElementsByName(‘child’)[0].checked){nChild = true}

var n = 0;

for (i=0; i<dogs.length; i++)
{
if (nSize == dogs[i][0] && nCoat == dogs[i][1] && nEnergy == dogs[i][2] && nChild == dogs[i][3])
{
buildList(dogs[i][5],dogs[i][4])
}
}
if (document.forms[1][‘matched’].length == 1)
{alert(‘No Matches Found’)}
}

</script>
</head>
<body>

<form>
<fieldset align=’center’ style=’font-size:12pt;width:625px;padding:5px’>
<legend style=’font-size:14pt;color:darkblue;padding:3px’> Choose a dog</legend>

<label>Select its size
<select name=”size”>
<option value=””> Choose </option>
<option value=”l”>Large </option>
<option value=”m”>Medium </option>
<option value=”s”>Small </option>
<option value=”d”>Any </option>
</select>
</label>

&nbsp;&nbsp

<label> Select its coat
<select name=”coat”>
<option value=””> Choose </option>
<option value=”s”>Short </option>
<option value=”l”>Long </option>
<option value=”d”>Any </option>
</select>
</label>

&nbsp;&nbsp

<label> Select its level
<select name=”energy”>
<option value=””> Choose </option>
<option value=”h”>High Energy </option>
<option value=”l”>Low Energy </option>
<option value=”d”>Any </option>
</select>
</label>

<br><br>

<label> Should the dog be good with children? </label>
<label> Yes <input type=”radio” NAME=”child”> </label>
<label> No <input type=”radio” NAME=”child” checked> </label>

<br><br>

<input type=”button” value=”Submit” onclick=”chooseDog(this.form)”>
&nbsp;&nbsp;
<INPUT TYPE=reset>
</fieldset>
</form>

<form>
<fieldset align=’center’ style=’font-size:12pt;width:625px;padding:5px’>
<legend style=’font-size:14pt;color:darkblue;padding:3px’> Matched Dogs</legend>

<select name=’matched’ onchange=”displayPhoto(this.value)”>
<option value=””> Select to View a Photo </option>
</select>
</fieldset>
</form>

</body>
</html>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @d333mu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...