Log in

View Full Version : Duplicate current code i use



theremotedr
05-17-2019, 09:08 AM
Good morning,
Here is an example page in question https://www.theremotedoctor.co.uk/kars2000.html?scrollto=selection

You will see that there are two buttons,CLICK TO ORDER & CLICK FOR PRICE

If you press CLICK FOR PRICE before you make a selection from the ITEM SELECTION on the right then you will see a red message appear.

This is how it should work because you need to select an item from the ITEM SELECTION on the right THEN press CLICK FOR PRICE.

Now looking at CLICK TO ORDER i would like the same red message to be shown if NO item was selected from the ITEM SELECTION.
Currently if you just press CLICK TO ORDER then when you complete the order form the part number is not populated because you did not select the ITEM.

Sorry i am not to clever at explaining things but basically if either button is pressed without selecting from the ITEM SELECTION then show red message.

Below is the code in use at present.


<!-- main content area -->
<div class="wrapper" id="main">

<!-- content area -->
<section id="content" >

<h1><img src="m-images/dr-logo-speech-bubble.png" alt="Honda car key remote programming" id="mainImage" /></h1>

<h1 ><a id="btnOrder1" href="https://form.jotformeu.com/form/62115565434352" target="_self">

<img src="m-images/order-logo.png" alt="order from the remote doctor website" class="buttonshadow"></a>

<a href="javascript:;">

<span id="warning">*WARNING*<br><br>PLEASE MAKE AN ITEM SELECTION FIRST</span>

<img src="m-images/price-logo.png" alt="remote doctor information button" class="tooltip border buttonshadow" ></a></h1>

</section>
<!-- #end content area -->

coothead
05-17-2019, 07:05 PM
Hi there theremotedr,



good evening to to you. ;)

Try these modifications...

HTML

Change, where appropriate, these items...



<a id="btnOrder1" href="https://form.jotformeu.com/form/62115565434352" target="_self"><img src="m-images/order-logo.png" alt="order from the remote doctor website" class="buttonshadow"></a>

...to this...



<a id="btnOrder1" href="https://form.jotformeu.com/form/62115565434352" target="_self">
<span id="warning1">*WARNING*<br><br>PLEASE MAKE AN ITEM SELECTION FIRST</span>
<img src="m-images/order-logo.png" alt="order from the remote doctor website" class="buttonshadow">
</a>


CSS and JavaScript

Change your "latestChanges.css" file and your "warning.js" file
with those in the following attachments.



coothead

theremotedr
05-18-2019, 05:55 PM
Many thanks worked a treat.

coothead
05-18-2019, 06:02 PM
No problem, you're very welcome. ;)


coothead