0

So I have a webform that I have made using html and javascript (i'm not a programmer) and I have found some CSS code that makes it look pretty but I had to re-do my form an give it different tags ie (<label>, <p> <fieldset>) which wasn't in my original code. Now all of my document.affiliateForm.afc4.value= somevalue; statements don't write to their fields anymore instead they push to the url (/index.html?somevalue=x&someothervalue=y). Does anyone know what could be causing this? I feel pretty certain that this is not due to my javascript since everything worked before I changed these tags and since the values pushed to the url are all correct.

Any help here would be great

<fieldset>
<legend>How much can you make?</legend>
<form name="affiliateForm">
<p>
    <label for="you">How many members will you refer:</label>
    <input class="fixed" type="text" name="you">
</p>
<p>
    <label for="them">How many members will they refer:</label>
    <input class="fixed" type="text" name="them"><br />
</p>
<p class="nolabel">
    <button onClick="calculateAffiliate()">Calculate Affiliate Amount</button>
</p>
<br>
<!-- End Entry Fields -->

<!-- Field Names -->
<p>
<label class="matrix">Levels:</label>
<input type="text" name="cst" value="Customer" value="Level" disabled>
<input type="text" name="com" value="Commission" value="Level" disabled>
<input type="text" name="afc" value="Affiliate Commision" value="Level" disabled>
<input type="text" name="pab" value="Platinum Affiliate Bonus" value="Level" disabled>
</p>
<!-- End Field Names -->
<!-- Start Level 1 -->
<p>
<label class="matrix">Level 1:</label>
<input type="text" name="cst1">
<input type="text" name="com1">
<input type="text" name="afc1">
<input type="text" name="pab1">
</p>
<!-- End Level 1 -->
<!-- Start Level 2 -->
<p>
<label class="matrix">Level 2:</label> 
<input type="text" name="cst2">
<input type="text" name="com2">
<input type="text" name="afc2">
<input type="text" name="pab2">
</p>
<!-- End Level 2 -->
<!-- Start Level 3 -->
<p>
<label class="matrix">Level 3:</label> 
<input type="text" name="cst3">
<input type="text" name="com3">
<input type="text" name="afc3">
<input type="text" name="pab3">
</p>
<!-- End Level 3 -->
<!-- Start Level 4 -->
<p>
<label class="matrix">Level 4:</label> 
<input type="text" name="cst4">
<input type="text" name="com4">
<input type="text" name="afc4">
<input type="text" name="pab4">
</p>
<!-- End Level 4 -->
<!-- Start Level 5 -->
<p>
<label class="matrix">Level 5:</label>  
<input type="text" name="cst5">
<input type="text" name="com5">
<input type="text" name="afc5">
<input type="text" name="pab5">
</p>
<!-- End Level 5 -->
<!-- Start Level 6 -->
<p>
<label class="matrix">Level 6:</label> 
<input type="text" name="cst6">
<input type="text" name="com6">
<input type="text" name="afc6">
<input type="text" name="pab6">
</p>
<!-- End Level 6 -->
<!-- Start Level 7 -->
<p>
<label class="matrix">Level 7:</label> 
<input type="text" name="cst7">
<input type="text" name="com7">
<input type="text" name="afc7">
<input type="text" name="pab7">
</p>
<!-- End Level 7 -->
<!-- Start Level 8 -->
<p>
<label class="matrix">Level 8:</label> 
<input type="text" name="cst8">
<input type="text" name="com8">
<input type="text" name="afc8">
<input type="text" name="pab8">
</p>
<!-- End Level 8 -->
<!-- Start Level 9 -->
<p>
<label class="matrix">Level 9:</label> 
<input type="text" name="cst9">
<input type="text" name="com9">
<input type="text" name="afc9">
<input type="text" name="pab9">
</p>
<!-- End Level 9 -->
<!-- Start Level 10 -->
<p>
    <label class="matrix">Level 10:</label> 
    <input type="text" name="cst10">
    <input type="text" name="com10">
    <input type="text" name="afc10">
    <input type="text" name="pab10">
</p>
<br>
<!-- End Level 10 -->

<!-- Totals -->
<p>
    <label for="total1">Total Affiliate Commission:</label>
    <input class="fixed" type="text" name="total1">
</p>
<p>
    <label for="total2">Total Platinum Affiliate Bonus:</label>
    <input class="fixed" type="text" name="total2">
</p>
<p>
    <label for="total">Total Payout</label>
    <input class="fixed" type="text" name="total">
</p>
<!-- End Totals -->

</fieldset>
</form>

Edit *****

I added the method="POST" that was suggested which does keep the code from showing up in the URL however it still disappears from the fields.

2 Answers 2

2

If you use <form name="affiliateForm" method="POST"> the fields wont be appended anymore. As method="GET" is the standard, the fields are pushed to the url if you don't specify otherwise.

Sign up to request clarification or add additional context in comments.

1 Comment

So this stops it from pushing to the URL but all of the fields remain blank. My script before would populate the fields with the calculations. Its supposed to look like an excel sheet. The purpose is to show what you could make in referrals
0

Hey everyone sorry if anyone spent any time on this. I figured it out, my version of the code used while the css form that I switched to used .

I guess as you said submits these values somewhere depending on whether or not you have post of get(default) set. Not really sure on what the input button does but it works for my code.

I'm going to give k_wave the credit since my question probably didn't give enough information for him to see what I had done differently. Thanks for the help!

Thanks,

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.