English 中文(简体)
Jquery and two form
原标题:Jquery and two form
  • 时间:2011-01-15 01:58:17
  •  标签:
  • jquery
  • forms

I ve a page with 10 fields. They are the fields for insert the players of a game s tournament. When the user click "submit" I want a modal dialog with jquery that says "Insert numbers of prized positions" with a field for insert a number. After click submit on dialog I send the data (fields for players and number of prized positions) to another page that process them.

我如何能够这样做?

增 编

问题回答

如果你使用JQuery UI s Dialog 箱,它实际上只是一种形式,其中一半在你开始的时候就隐藏了。

J Query UI Dialog只不过是一片 d。 因此,在你的形式标签内,你只需要打造一个id子,如“方言箱”。 在干.中,你将把你希望看到的田地放在联log中,并将实际形式提交纽顿。 接着,在装页码上,执行

$( "#dialog-box" ).dialog({autoOpen: false, modal: true});

在首页的纽芬兰语不是提交纽特语的一种实际形式,而只是一个标准纽芬兰语,有点功能执行。

$( "#dialog-box" ).dialog( "open" );

当用户在方言窗口中点击提交纽芬兰时,将把整个表格提交服务器。

http://jqueryui.com/demos/dialog/“rel=“nofollow”http://jqueryui.com/demos/dialog/

$("#submitbutton").click(function() {
  $("#target-for-input").html("<label for= prizes >Insert numbers of prized positions</label><input type= text  name= prizes  id= prizes ");
  $(this).unbind("click"); //no click even makes sure form is submitted the normal way when hitted the button again
  return false; //makes sure the normal behavior of submit is not triggered.
});

use jQueryUI.Dialog Bind popping up the dialog to submitStage1 then the whole form is submitted via submitStage2

<form action="/myaction" method="post">
   <!-- form contents -->
   <div id="dialog">
      <!-- dialog contents -->
      <input type="submit" id="submitStage2" value="Submit" />
   </div>
   <button id="submitStage1">Submit</button>
</form>




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签