473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

jquery dialog form

pradeepjain
563 512MB
hii.. i use cope like this

Expand|Select|Wrap|Line Numbers
  1.            <td><a href='/login.php' id="view-user" >Pradeep</a></td>
and defauly jquery dialog code

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. $(function() {
  3. $("#dialog").dialog("destroy");
  4. $("#dialog-form").dialog({
  5.                         autoOpen: false,
  6.                         height: 300,
  7.                         width: 350,
  8.                         modal: true,
  9. /*                      buttons: {
  10.                                 'Create an account': function() {
  11.                                         var bValid = true;
  12.                                         allFields.removeClass('ui-state-error');
  13.  
  14.                                         bValid = bValid && checkLength(name,"username",3,16);
  15.                                         bValid = bValid && checkLength(email,"email",6,80);
  16.                                         bValid = bValid && checkLength(password,"password",5,16);
  17.  
  18.                                         bValid = bValid && checkRegexp(name,/^[a-z]([0-9a-z_])+$/i,"Username may consist of a-z, 0-9, underscores, begin with a letter.");
  19.                                         // From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
  20.                                         bValid = bValid && checkRegexp(email,/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,"eg. ui@jquery.com");
  21.                                         bValid = bValid && checkRegexp(password,/^([0-9a-zA-Z])+$/,"Password field only allow : a-z 0-9");
  22.  
  23.                                         if (bValid) {
  24.                                                 $('#users tbody').append('<tr>' +
  25.                                                         '<td>' + name.val() + '</td>' +
  26.                                                         '<td>' + email.val() + '</td>' +
  27.                                                         '<td>' + password.val() + '</td>' +
  28.                                                         '</tr>');
  29.                                                 $(this).dialog('close');
  30.                                         }
  31.                                 },
  32.                                 Cancel: function() {
  33.  $(this).dialog('close');
  34.                                 }
  35.                         },*/
  36.                         close: function() {
  37.                                 allFields.val('').removeClass('ui-state-error');
  38.                         }
  39.                 });
  40.  
  41.  
  42.  
  43.                 $('#view-user')
  44.                         .button()
  45.                         .click(function() {
  46.                                 $('#dialog-form').dialog('open');
  47.                         });
  48.  
  49.         });
  50.         </script>
  51.  

the problem is that only if the div dialog-form is in this page it opens up the dialog . cant i make it open the page login.php where the div dialog-form is there ?
Mar 21 '10 #1
3 4927
gits
5,390 Expert Mod 4TB
i doubt that ... how should
Expand|Select|Wrap|Line Numbers
  1. $("#dialog-form")
perform then? you would need to have the node before the javascript code could successfully run ... probably you might load the document via an ajax call and then let the script run in a callback ...

kind regards
Mar 21 '10 #2
pradeepjain
563 512MB
can you just show some code sample!!i am not that well wersed in ajax/jquery
Mar 21 '10 #3
gits
5,390 Expert Mod 4TB
don't know jQuery well ... basicly you would need to make an ajax-call and call your dialog from its complete callback - have a look here ...

kind regards
Mar 21 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: ziobudda | last post by:
Hi, I want ask you if, for a web portal/application, is better prototype or Jquery? I don't want to innesc some type of flame, but after the announce that drupal use JQuery and that the new...
2
by: darrel | last post by:
I'm still struggling to find a javascript/ajax library that I want to stick with for a while. JQuery is looking great these days...refined, LOTS of plug-ins, and an active community. Is...
2
by: Darrel | last post by:
I'd like to use the jquery datepicker. I have a asp.net 1.1 application set up with forms authentication protecting an admin directory: <location path="admin"> <system.web> <authorization>...
1
by: Big Moxy | last post by:
This plugin can be downloaded from http://www.phpletter.com/DOWNLOAD/. I want to add 2 fields to the sample form but do not know how. The variable s.fileElementId in the function ajaxFileUpload...
1
by: mikeh3275 | last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
83
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about...
3
by: NetWave | last post by:
Hi, For my next project I'm going to need Ajax, so I'm in about to read some books on ASP.NET Ajax. While reading Rick Strahl's blog I stumbled upon jQuery. I've been to the website and seen...
2
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%=...
26
by: RobG | last post by:
Do some of the regulars here need to re-think their (sometimes strident) opposition to libraries? Both Microsoft and Nokia have announced support for jQuery. It seems to have gained quite a bit...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.