Jump to content
MakeWebGames

Jquery


rockwood

Recommended Posts

i am doing on attac.php

<script type="text/javascript">

$(function () {

$('#content').load('attack.jquery.php?ID=<?php echo $_GET['ID']?>');

});

</script>

// this part is not working

<script type="text/javascript">

$("#submit_b").click(function(){

$("#usefists").submit();

$(function () {

$('#content').load('attack.jquery.php?ID=<?php echo $_GET['ID']?>');

});

});

//-------------------------------from attack.jquery.php---

<form id="usefists" name="usefists" method="post">

<input type="hidden" name="fist" id="fist" value="fist">

<input type="button" name="submit" id="submit_b"

style="color:#A1A1A1;font-weight:700;width:200px; height:40px; border:2px; cursor:pointer;

background: url(images/attack/hand.jpg) no-repeat center top;"

value="Fists"

</form>

i am unable to submit form

Any chance you can use [*code] tags and indentation for ease of viewing?

Link to comment
Share on other sites

Try:

<div id="content"></div>
<script>
   ( function ( $ ) {
       $(function () {
           var content = $('#content'),
               url = 'attack.jquery.php?ID=<?php echo $_GET["ID"]; ?>';

           content.load ( url );
           $('#submit_b').on ( 'click', function ( e ) {
               e.preventDefault();
               $('#usefists').submit();
               content.load ( url );
           });
       });
   })(jQuery);
</script>
<form id="usefists" name="usefists" method="post">
   <input type="hidden" name="fist" id="fist" value="fist">
   <input type="button" name="submit" id="submit_b" 
       style="color:#A1A1A1;font-weight:700;width:200px; height:40px; border:2px; cursorointer;
           background: url(images/attack/hand.jpg) no-repeat center top; "value="Fists" />
</form>

Pastie

Or:

<div id="content"></div>
<script>
   ( function ( $ ) {
       $(function () {
           var content = $('#content'),
               url = 'attack.jquery.php?ID=<?php echo $_GET["ID"]; ?>';

           content.load ( url );
           $('#usefists').submit ( function ( e ) {
               content.load ( url );
               e.preventDefault();
           });
       });
   })(jQuery);
</script>
<form id="usefists" name="usefists" method="post">
   <input type="hidden" name="fist" id="fist" value="fist">
   <input type="button" name="submit" id="submit_b" 
       style="color:#A1A1A1;font-weight:700;width:200px; height:40px; border:2px; cursorointer;
           background: url(images/attack/hand.jpg) no-repeat center top; "value="Fists" />
</form>

Pastie

Edited by Djkanna
Link to comment
Share on other sites

still the same problem

Not being rude or anything but instead of posting meaningless replies actually read up on the API, instead of jumping in and constantly asking for help, start at the beginning then work your way up. Of course you still have the same problem Dominion didn't post a solution then.

Link to comment
Share on other sites

lol i am new so dont know decent way but now i got it thanks Script47 and ill keep in mind your words

You joined 2 years ago?, decent way of what?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...