Jump to content

trampolinejoe

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

About trampolinejoe

  • Birthday 07/05/1988

Profile Information

  • Gender
    Male
  • Location
    Brisbane

trampolinejoe's Achievements

Member

Member (2/5)

0

Reputation

  1. this fourm says it can not be done, is this true? http://www.ozzu.com/programming-forum/can-you-write-php-inside-javascript-code-t38065.html
  2. hey man, Thanks for that, well I had a read and it said that they are less portable, do you know what that means exactly? And also, I tried the tag your style with the ?> and it is being very strange, its actually breaking the option topdown. I am having trouble testing my could because when I right click in the browser to try and see what the output of the code is I can not see any code because the code that was generated by innerHTML arnt appearing in the source code. So I dont know what to do because the code is hidden so anything I try and test I can't see the output. What I am getting is an extra '>' appearing as a string in the name in mydrop down menu and also actually set the value of the variable as [$netA ='selected="selected"'; ]but the thing is that means that item should be selected on load if the php was actually writing in the js. It is not appearing as selected so I am alittle confused.
  3. Hey man, Why is using short tags discouraged? Also, what is the difference between what I was doing already and what your code is? Thanks man.
  4. Hello Guys, I am making a form which loads different menu options depending on what the users previous selections are. I am also making the form so that if somebody loads the form and they have been to the page before it will pre-fill the form to there specific details. When I write with php in between the js the form stops working, why would this be? Here is what I am trying to do: function change() { switch (document.getElementById("product").value) { case "OptionA": document.getElementById("change").innerHTML = " <select name='net' id='net'> <option value='tentA'<?=$netA; =>>Include Net + $129.00</option> <option value='tentB'<?=$netB; =>>Do No Include Net</option>" break; case "OptionB": document.getElementById("change").innerHTML = " <select name='tent' id='tent'> <option value='tentA' <?=$tentA; =>>Include Net + $129.00</option> <option value='tentB' <?=$tentB; =>>Do No Include Net</option>" break; }
  5. I am sure you could post to the same page, or you could even point to a page that you do not have either doesn't make a difference to the fact that it is still submitting the page. However, I have noticed why it is doing this, I forgot to make the function 'return false' and that was the cause of the issue. I thank you for your time anyways. Cheers, Joe.
  6. Well, onePost.php is a blank page atm, I havn't started coding it because I am not up to that yet. I was under the impression that the form validation could be done on the same page with js and that the contents of the page which posts is not important at this stage because we shouldn't even be posting to that page under the condition that the 'empty' option is selected we should get the alert and then stay on the same page. Please correct me if I am wrong. Cheers, Joe.
  7. Hello, Thanks for the fast response! I should have posted it as a single thing from the 1st post. I have included the html I used got my form, other then that it's pretty much the same. Cheers. <script type = "text/javascript" language = "Javascript"> function empty(){ if ( document.form1.productArray.value == "empty" ) { alert("You have not selected a product, please select a product."); valid = false; } } </script> <form name="form1" method="post" action="onePost.php" > <select name="productArray" id="productArray"> <option value="empty">--Please Select--</option> <option value="8fttrampoline2009">8ft Trampoline </option> <option value="10fttrampoline2009">10ft Trampoline </option> </select> <input name="next" type="submit" onClick="return empty()" value="Next >>"> </form>
  8. Try changing your form tag to action='example.php' and see if it stills works fine. I think it maybe no posting for you because it dosn't know what to do. Other then that all I can think of it the fact I have a separate file for my js.
  9. Hello People, I am starting with some basic form validation with js. How do I stop this posting to the next page if the error occurs? No matter what I do even if the error occurs it seems to post to the next page. My JS Function: function empty(){ if ( document.form1.products.value == "empty" ) { alert ( "You have not selected a product, please select a product." ); valid = false; } } Drop Down Menu: <select name="productArray" id="productArray" onChange="change()"> <option value="empty">--Please Select--</option> <option value="8fttrampoline2009">8ft Trampoline <?php echo'$'."$eightfttrampoline".'.00'; ?></option> <option value="10fttrampoline2009">10ft Trampoline <?php echo'$'."$tenfttrampoline".'.00'; ?></option> </select> Submit Button: <input name="next" type="submit" onClick="return empty()" value="Next >>">
  10. * I mean every page not everyday (Sorry I am a little tired)
  11. Hello Guys, I have created a function that I will need to use on almost everyday on the website. If i have it included in a file on everyday page it dosn't seem to work. Is there another way of doing this? How would I do this? Thanks Guys
  12. G'day Wolf! Good to see you again! I have it so close to working now! ok, now! to finsh it off I need to be able to post the following variables to the page so that it can create the key. <input type="hidden" name="EPS_TIMESTAMP" value="<?php echo $timestamp; ?>"> <input type="hidden" name="EPS_MERCHANT" value="ID893240"> <input type="hidden" name="EPS_PASSWORD" value="XXXX"> <input type="hidden" name="EPS_REFERENCEID" value="<?php echo $referenceid; ?>"> <input type="hidden" name="EPS_AMOUNT" value="<?php echo $amount; ?>">
  13. I am going to mark this one as solved, as I started a new post I feel like the post has gone alittle more specific now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.