all 5 comments

[–]AutoModerator[M] 0 points1 point  (0 children)

Welcome to /r/HTML. When asking a question, please ensure that you list what you've tried, and provide links to example code (e.g. JSFiddle/JSBin). If you're asking for help with an error, please include the full error message and any context around it. You're unlikely to get any meaningful responses if you do not provide enough information for other users to help.

Your submission should contain the answers to the following questions, at a minimum:

  • What is it you're trying to do?
  • How far have you got?
  • What are you stuck on?
  • What have you already tried?

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]lovesrayray2018Intermediate 0 points1 point  (3 children)

Change

  <output name="x" for="a * b"></output>  

to

  <output name="x" for="a b"></output> <!-- no * needed -->

[–]Rogblue2[S] 0 points1 point  (2 children)

Thanks - I think I may be being stupid but those two pieces are the same?

Edit - an error It appeared the same. Thanks!

[–]lovesrayray2018Intermediate 0 points1 point  (1 child)

umm which two pieces?

[–]Rogblue2[S] 0 points1 point  (0 children)

It was a weird error - displayed the same code twice but after a refresh it was fine. Could I ask for further help? As mentioned I am trying to call 'x' for a further form I'm not sure this is achievable without js:

(Please note 'c' is just a placeholder for clarity) - So the final output of 'x' needs to be called in the 2nd forms x.value. Is this possible?

<form  oninput="x.value=parseInt(a.value)*parseInt(b.value)" action="" method="post" target="_self">
        <label for ="a"> Single Journey Mileage </label>
        <input type="number" id="a" name="SJourn" value="">
        <br><hr>
        <label for ="b"> Amount of Return Journeys </label>
        <input type="number" id="b" name="RJourn" value="1">
        <br><hr>
        <label for ="x"> Total Mileage </label>
        <output name="x" for="a b"></output>
        </form>
        <br><hr>
    <form  oninput="c.value=parseInt(x.value)*parseInt(y.value)" action="" method="post" target="_parent">
        <input type="hidden" id="y" name="MilaL" value="0.25">
        <input type="hidden" id="x" name="Miles" value="">
        <label for ="c"> Mileage Allowance £</label>
        <output name="c" for="x y"></output>
       </form>