473,396 Members | 1,938 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,396 software developers and data experts.

Divide data for form?

I am currently pulling a 10 digit number form a database and propulating a form.

I have recently changed the form to 3 input boxes and can't figure out how to split the data (i.e. xxx, xxx, xxxx).

Here is snippet from my current code:

Expand|Select|Wrap|Line Numbers
  1. function loadModalPromo()
  2. {
  3.     modalpromo = new Boxy("<?php loadPromoModalContent(); ?>", {title: "I do not have a Promo Code", modal: false, closeable: true, show: false });
  4.  
  5.     $("#mphavecontact").click(function() {
  6.         modalpromo.hide();
  7.     });
  8.  
  9.     $("#mpnotcontact").click(function() {
  10.         $("#mpoptionform").hide();
  11.         $("#mpgettingpromo").show();
  12.         $.ajax({
  13.            type: "POST",
  14.            url: "yhfiles/ajaxgetpromo.php",
  15.            data: "key=" + "<?php echo $_SESSION["ajaxget_promo_key"]; ?>",
  16.            success: function(msg){
  17.              if(msg.length == 10)
  18.              {
  19.                 $("#logpromo").val(msg);
  20.              }
  21.              else
  22.              {
  23.                  alert("Error in retrieving the promo code. Please contact the administrator.");
  24.              }
  25.            },
  26.            complete: function(msg){
  27.                $("#mpoptionform").show();
  28.                $("#mpgettingpromo").hide();
  29.                modalpromo.hide();
  30.            }
  31.          });
  32.  
  33.  
  34.     });
  35. }
Any help would be appreciated.
Aug 5 '10 #1
1 1239
johny10151981
1,059 1GB
if you do it with php
Expand|Select|Wrap|Line Numbers
  1. $value="1234567890";
  2. $part1=substr($value,0,3);
  3. $part2=substr($value,3,3);
  4. $part2=substr($value,6,4);
  5.  
want to do with javascript
Expand|Select|Wrap|Line Numbers
  1. var value="1234567890";
  2. var part1=value.substr(0,3);
  3. var part2=value.substr(3,3);
  4. var part3=value.substr(6,4);
  5.  
Aug 5 '10 #2

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

Similar topics

0
by: James | last post by:
Hello, I have about 15 master catalogs, or master tables, of information that my application uses. The data form wizard is fine because most of them have between 20 and 200 items in them. ...
3
by: David C. Allen | last post by:
I am following thru the examples in the book I am studying for my MCSD. This is the web applications book. One example is to use the data form wizard to create a simple data form on the...
1
by: Zal | last post by:
hi, i would like someone to confirm something for me, i have the trail edition of vs.net2003 which i will upgrade to the standard edition,once i get it through the post. ive been looking at a...
1
by: Jeff Brown | last post by:
I am developing my First "Real" app and i am running in to the following problem. I use the data form wizard to create a form, so i do not have to manually do all the binding. But the only thing...
1
by: AndrwChau | last post by:
I just want to know how many user are use the Data Form wizard to generate the input form. Is most of programmer use the wizard to generate the input form or they are create one by themself. Is...
6
by: Bob | last post by:
I've located instruction as to how to add the Data Form Wizard into a VB.NET 2005 project at this location. ...
1
by: Avi G | last post by:
Hi, i use VS2005 Pro and i can't find the "Data form Wizard" when i try to include it to my form, where can i find it , or maybe there is something else that do the same thing? i need to bind a...
6
by: shivavrata | last post by:
Hi All, I want to transfer the data form webpage to any other own application which is running in backend.How i develop this web page. which technology is good for this or any particular protocol...
3
by: nkoriginal | last post by:
Hello: I tried an script for keep my data form after reload page, but I've some errors. In this momento I runnung my own browser because we've an intranet. And for security reason, our page...
3
by: Saucer Man | last post by:
....in Visual Basic.net 2008 Express? -- Thanks!
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.