Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit Button and CSS

Status
Not open for further replies.

JustineB

Programmer
Mar 30, 2001
165
GB
I am having problems making a JavaScript call from a submit button after placing it in a style sheet 'box'

The call works fine in an old HTML page as either an image or button but when placed between <div>'s it gives an error messsage which I have been unable to trace.

The original code is

<td>
<p><h5>Hanes H2</h5></p>
<li>Blah</li>
<li>Blah</li>
<li>Blah</li>
<li>Blah</li>
<li>Blah</li>
<li>Blah</li>
<p><b>£8.50<br>
Price includes V.A.T. and delivery.</b></p>
<p><h6>Sizes and colours shown are approximate and for guidance only</h6></p>
</td>
<td>
<form name="product" onsubmit="return(Add2Basket(this));return(false);">
<h6>Quantity</h6>
<p>
<input type="text" name="Quantity" size=4 value="1" onChange='top.qty_fix(this,1,1)'>
</p>
<p>
<select name="SEL1" >
<OPTION SELECTED>Select size



<OPTION>S 10/12



<OPTION>M 14



<OPTION>L 16
</select>
</p>

<p>
<select name="SEL2">
<OPTION>BLACK



<OPTION>SLATE GREY



<OPTION>FRENCH NAVY</p>
</select>
<h5>Approximate colour samples<br>are shown below.</h5>


<p><INPUT TYPE="submit" VALUE="Add to Basket"></p>
</form>
<p><INPUT TYPE="BUTTON" VALUE="Review Basket" ONCLICK="top.reviewbasket(true)"></p>
</td>

The new code is :-

<div class="bravo">
<form name="product" onsubmit="return(Add2Basket(this));return(false);">
<h6>Quantity</h6>
<p>
<input type="text" name="Quantity" size=4 value="1" onChange='top.qty_fix(this,1,1)'>
</p>
<p>
<select name="SEL1" >
<OPTION SELECTED>Select size



<OPTION>S 10/12



<OPTION>M 14



<OPTION>L 16
</select>
</p>

<p>
<select name="SEL2">
<option>SELECT COLOUR
<OPTION>BLACK



<OPTION>SLATE GREY



<OPTION>FRENCH NAVY</p>
</select>
<h5>Approximate colour samples<br>are shown below.</h5>


<p><INPUT TYPE="submit" VALUE="Add to Basket"></p>

<p><INPUT TYPE="BUTTON" VALUE="Review Basket" ONCLICK="top.reviewbasket(true)"></p>
</form>
</div>

In both cases the 'Add to Basket' call works fine.
I have tried adding "javascript:top. reviewbasket(true)" but this doesn't work either.

Can anyone help please ?
 
Could it be:

old code:
Code:
<p><INPUT TYPE="submit" VALUE="Add to Basket"></p>
[b]</form>[/b]
<p><INPUT TYPE="BUTTON" VALUE="Review Basket" ONCLICK="top.reviewbasket(true)"></p>

new code:
Code:
<p><INPUT TYPE="submit" VALUE="Add to Basket"></p>

<p><INPUT TYPE="BUTTON" VALUE="Review Basket" ONCLICK="top.reviewbasket(true)"></p>
[b]</form>[/b]


There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top