Avijit Kumar

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromAvijit Kumar
ToMe
Subjectproblem in adding a new row for the user input data
Date28 September 2004 13:15
Dear Sir,

I have a table, that is having 5 column and one row in which user can input
data. Initially the table should have one row. In one row there are 4 text
field and one select type option.After the user input data, the user can
click a button to create a new row to input more data. After the user
finishes, I want to send the data to server then after click on button it
will automatically generate new input data row i.e vice versa. There is
also the option of edit,view, and save button, after clicking this buttons
user can edit, view and save the input data.

Please help me as soon as possible.

thanx

Abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in adding a new row for the user input data
Date28 September 2004 13:40
Abhijit,

QuirksMode has got an excellent article describing how to do exactly what you want:
http://www.quirksmode.org/dom/domform.html

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromAvijit Kumar
ToMe
Subjectproblem in adding rows and saving
Date29 September 2004 06:18
Dear Sir,

thanx for ur previous reply. But it is not so useful in context of my 
purpose.
I would like to have a row that is default and it will add another new row 
when the user clicked on the button 'add'. At the same time, when add new 
row was clicked, the data previously entered in the 1st row will be first 
inserted into the database and so on and it is saved in the form itself. I 
can also edit and view the enetred details, as i  eneterd before.

My form page goes this way:


plzzzzzzzzzzz help me as soon as possible

abhijit

[sample form HTML]
FromMe
ToAvijit Kumar
SubjectRe: problem in adding rows and saving
Date30 September 2004 08:26
Is there any particular reason why you keep sending me 5 copies of each
email? Are you having problems with your hotmail account?

> I would like to have a row that is default and it will add another new row 
> when the user clicked on the button 'add'. At the same time, when add new 
> row was clicked, the data previously entered in the 1st row will be first 
> inserted into the database and so on and it is saved in the form itself.

To do this make the 'add' button be a button of type 'submit', and give it
a name and value. You will need to use a server side script to check if
this variable exists (it will only exist if it is the button that they
clicked). If it exists, make the server side script add the information
that it was sent into the database. Then read all of the information out of
the database (this will include rows that were saved earlier), and use
those to write the rows again. Add an extra row on the end also. To help
you do this, make the names of the inputs in the row use the name of an
array. server side languages like PHP allow you to index these
individually:
..row 1...
<input name="code[0]" ... >
..row 2...
<input name="code[1]" ... >
This way, you will be able to identify which is which on the server.

> How can I do that a user double clicks or only a click over a row to select 
> this row?

There are two ways that you can do this:

1. using labels - when clicked, they automatically tick the associated
checkbox
<tr>
<td><input type="checkbox" name="selected0" id="selected0" value="1"></td>
<td><label for="selected0">Something else</label></td>
</tr>
you can then use a server side script to cycle theough all the possible
checkbox names and check if they are ticked

2. using JavaScript - this has accessibility problems
<tr onclick="
this.className=this.className?'':'selected';
document.forms['nameofform'].row0selected.value='1';
"><td><input type="hidden" name="row0selected" value="">
FromAvijit Kumar
ToMe
Subjectproblem in submit the entered data to the database
Date30 September 2004 10:33
Dear Sir,

thanx mark foe ur valuable information,

I have made a form in which i have used html and javascript language.

The form is looks like a data entry form,in which there are text type and 
select type option.

I have also made all the validation also.

The next thing is that i want to submit the entered data to the database.

PLZZZZZZZZZZZZZZ help me to how to send the users entered data to database.


PLzz send me immd.


Abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in submit the entered data to the database
Date30 September 2004 17:03
To send data to a database, you must submit your form to a web page that
uses a server side programming language, and you need access to a database.
Server side programming languages include:
PHP, Perl, JSP, ASP, ESP
Databases include:
MySQL, PostgreSQL, Oracle, MSSQL, MS Access
You must use what your host provides.

The most commonly used combination is PHP and MySQL. You will need to look
on those sites for a tutorial, or look on http://www.w3schools.org/
http://www.php.net/manual/en/
http://dev.mysql.com/doc/mysql/en/Tutorial.html
FromAvijit Kumar
ToMe
SubjectRe: problem in submit the entered data to the database
Date1 October 2004 05:06
sir iam  using JSP for server side proframming and oracle database.

can u help me.

abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in submit the entered data to the database
Date1 October 2004 08:06
Sorry, I do not know JSP at all. Oracle querying syntax is like MySQL
syntax, but with a few extra features. If you use the MySQL tutorial, it
should help you learn Oracle also.

Maybe you can find something on Google that does what you need:
http://www.google.com/search?q=oracle+jsp+tutorial
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of this range of data 0 - 99.99
Date18 October 2004 13:31
Sir,



I have a text field in a table.That text field must be with inthe range of  
0 - 99.99

Please help me, i have  made a form in html  and did validation in 
JAVASCRIPT.

Plz help me for the validation of this range of data.


thanx


abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in submit the entered data to the database
Date18 October 2004 14:20
<input name="whatever" type="text" size="6" maxlength="5" onblur="
var theNum = parseFloat(this.value);
if( isNaN( theNum ) || theNum < 0 ) {
 this.value = 0;
} else if( theNum > 99.99 ) {
 this.value = 99.99;
} else {
	this.value = theNum;
}
" value="0">
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of this range of data 0 - 99.99
Date19 October 2004 5:49
thanx this is very useful for me, bu there is one problem occur, when ever i 
eneterd the value greater than 99.99 than it shows 99.99. i want to display 
an alert message indiavting that the value enterd is not in range, and the 
same as in whenever i entered the value less than 0 it display alert 
message.

thanx
FromMe
ToAvijit Kumar
SubjectRe: problem in submit the entered data to the database
Date19 October 2004 8:12
<input name="whatever" type="text" size="6" maxlength="5" onblur="
var theNum = parseFloat(this.value);
if( isNaN( theNum ) || theNum < 0 ) {
 alert('The number you entered was too low');
 this.value = 0;
} else if( theNum > 99.99 ) {
 alert('The number you entered was too high');
 this.value = 99.99;
} else {
	this.value = theNum;
}
" value="0">
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of this range of data 0 - 99.99
Date19 October 2004 10:09
Sir,
thanx for ur help.

But i have one problem in that program, whenever the alert message 
displayed, after that the incorrect value is not get disappeared.


sir plz help me, than when ever the alert error message displayed, the 
incorrect value displayed in text field should be ommitted.


thanx


abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in submit the entered data to the database
Date19 October 2004 10:13
If you want to change what it puts in the box when they make a mistake, you
can change the lines that tell it what to change it to. If you want to do
nothing, delete the lines

<input name="whatever" type="text" size="6" maxlength="5" onblur="
var theNum = parseFloat(this.value);
if( isNaN( theNum ) || theNum < 0 ) {
 alert('The number you entered was too low');

/****** I think this is what you want ******/
 this.value = '';


} else if( theNum > 99.99 ) {
 alert('The number you entered was too high');


/****** I think this is what you want ******/
 this.value = '';


} else {
 this.value = theNum;
}
" value="0">

You can put anything you want in there - just write whatever you want in
between the ' quotes.
FromAvijit Kumar
ToMe
Subjectthanx 4 u r help
Date19 October 2004 11:56
dear Sir.

thanx a lot. my problem get solved.

abhijit
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of number in text field and addition of number
Date19 October 2004 12:05
Dear sir,

Plz help me in the following cases:-

1) i have a input type text field, which value length should be 9(not more 
than that and less than that) and that value should be started by BP, it 
contain integer and alphabetic BP.

BP is unique.

for ex..  BP1000001


2)I have a two input type text, whenever the user click on TOTAL text, the 
sum of two input tpe value get added in Total field, and the Total value get 
disabled.

My text field as follows:-

<input type="text" name="debit" size="12">
<input type="text" name="credit" size="12">
<input type="text" name="Total" size="12">

plz help me

abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in validation of number in text field and addition of number
Date19 October 2004 12:47
1)

<input maxlength="9" onblur="
if(!this.value.match(/^BP[\d]{7}$/)) {
 alert('Format not valid');
 this.value = '';
}
">

2)

<input type="text" name="debit" size="12">
<input type="text" name="credit" size="12">
<input type="text" name="Total" size="12" onclick="
var oDebit = parseFloat(this.form.debit.value);
var oCredit = parseFloat(this.form.credit.value);
this.value = oDebit + oCredit;
" disabled>
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of additionof number
Date19 October 2004 14:02
Sir,

as per my second solution for the automatic addition of two number in 
another text field and get disabled.This function is not working, the effect 
is only the the field fet disabled but it not shown the addition of two 
input field.


plz help

abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in validation of additionof number
Date19 October 2004 14:10
replace 'disabled'  with 'readonly'
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of number
Date19 October 2004 14:51
Thanx 4 ur help


i have a input text field like that:

Cheque Date:
<input type="text" name="chqdate" size="10" maxlength="10">

i want to enter only the integer amount, there can be decimal in the 
integer, but not containing any alphabet.for ex. 78245454.232312 or 454.121 
or 5545545454545.00

and it automatically show the .00 after the number, for ex.  789.00, 745.00


thanx

abhijit
FromMe
ToAvijit Kumar
SubjectRe: problem in validation of number
Date19 October 2004 15:02
You have used the maxlength attribute, but you have said numbers that use
more than 10 characters. I will assume that you did not mean to put the
attribute in the tag

<input type="text" name="chqdate" size="10" onblur="
var x = parseFloat(this.value);
if(!this.value.match(/[\d]+\.?[\d+]/)) {
 alert('format not valid');
 this.value = '';
} else if( !(x%1) ) {
 this.value = x + '.00';
}
">
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of radio buttons
Date19 October 2004 15:02
sir,

there are two radio button as follow:

<DL>
Hold:<INPUT TYPE="RADIO" NAME="hold" VALUE="hold"> </dl>

<dl>
Post:<INPUT TYPE="RADIO" NAME="post" VALUE="post">
</DL>


i want to select only one option at a time, and if it is not selected, shows 
alert messages.

and this two radio button shows disabled at current form, and when we select 
a particular text field, it becomes active and from that we can choice only 
one option.


thanx


abhijit

The same bloody email repeated three times with different subjects because I didn't reply within 20 minutes

FromAvijit Kumar
ToMe
SubjectRe: problem in validation of time
Date19 October 2004 15:08
Sir,


i have a select type field in which i have to display current month dispaly 
only, not the future moth and year and not the past month and year.My form 
is as follows:

Current Processing Month

<select size="1" name="month" >

<option value="">Month</option>
<option value="1">Jan</option>
<option value="2">Feb</option>
<option value="3">Mar</option>
<option value="4">Apr</option>
<option value="5">May</option>
<option value="6">Jun</option>
<option value="7">Jul</option>
<option value="8">Aug</option>
<option value="9">Sep</option>
<option value="10">Oct</option>
<option value="11">Nov</option>
<option value="12">Dec</option>
</select>

<select size="1" name="year" >
<option value="">Year</option>
<option value=2010>2010</option>
<option value=2009>2009</option>
<option value=2008>2008</option>
<option value=2007>2007</option>
<option value=2006>2006</option>
<option value=2005>2005</option>
<option value=2004>2004</option>
</select>


Plz help me, please advice me that in place of select type field in above 
particular example,which type of field will be better, and as per that plzzz 
solved my above problem.



abhijit

The same bloody email repeated two times because I didn't reply within 6 minutes

FromMe
ToAvijit Kumar
SubjectRe: problem in validation of number
Date19 October 2004 15:15
abhijit,

Instead of asking me to write all these trivial scripts for you, why don't
you learn how scripting within forms works. I have already documented a
great deal of scripting like this. Try using my tutorial to teach yourself
JavaScript.
http://www.howtocreate.co.uk/tutorials/javascript/important
FromAvijit Kumar
ToMe
SubjectRe: problem in validation of date
Date19 October 2004 15:26
Sir,


i have a text field which display date only in dd/mm/yyyy format.the date 
should not be greater than the system date, if the date is greater than the 
system date then it displays error message.

Cheque Date:

<input type="text" name="chqdate"  >

plz advice can i put input type field or select type field or any else, as 
per the above problem.

thanx


abhijit

Still not had enough? I know, let's change our name to a girly name and send the same damned email. Of course he will take notice of a girl.

AAAAARRRGH!

Enough! Enough already!

Look, I don't mind helping, but I object to being exploited. I take my time to help you, but you cannot even be bothered to try to work out how to do any of this yourself. I am not a slave. I try to help you learn. I do not want to do your job. If you can't even do these basic things, and you are not even trying to learn, you shouldn't be doing this at all. You certainly should not be getting paid for it, because you are not doing anything yourself. You are exploiting other people. Oh, and saying 'Sir' (Note; I have a real name. It is Mark. I also have a nickname. It is Tarquin.) and 'plz' (Note; please is spelt 'please' not 'plz'. This is not AOL chat, and I am not 12.) repeatedly does not stop it being exploitation.

And most importantly, you definitely should not be writing pages that deal with peoples' sensitive information when you clearly lack even the most basic validation knowledge. This is serious. Incompetance is a serious problem when you are dealing with other people's information. This is how you get security problems, where you accidentally give away sensitive information to the wrong people. Learn how to do this properly before you do it. Try using a few tutorials, and learn to do it properly. Learn to do it for youself.

This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.