473,466 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Validation Required

18 New Member
Hi friends,
I am new to PHP. i need validations for Delete a record.

i store a column from Database table in a tabular format. i have edit and delete option. i need to write validations confirm (yes or no to delete the record) my code goes like this::::::

echo "<td width='68' ><a href='index2.php?option=com_qualification&cid=$cid &type=delete'> Delete</a> </td>";

// how to write validation in the above href and where to place it. plz suggest.

Regards,
Ram
Mar 13 '08 #1
8 1520
satas
82 New Member
Hi.
Is it what you are looking for?

[HTML]<a href="index2.php?option=com_qualification&cid=$cid &type=delete" onclick="return confirm('Delete item?');">Delete</a>[/HTML]
Mar 13 '08 #2
Ramu528
18 New Member
Hi.
Is it what you are looking for?

[HTML]<a href="index2.php?option=com_qualification&cid=$cid &type=delete" onclick="return confirm('Delete item?');">Delete</a>[/HTML]

hi satas,

i am getting the error, can u correct me where i am going wrong! plz

Parse error: syntax error, unexpected T_RETURN, expecting ',' or ';' in
Mar 13 '08 #3
satas
82 New Member
Try this:
[PHP]echo "<td width='68' ><a href='index2.php?option=com_qualification&cid=$cid &type=delete' onclick='return confirm(\"Delete item?\");'> Delete</a> </td>";[/PHP]
Mar 13 '08 #4
Markus
6,050 Recognized Expert Expert
hi satas,

i am getting the error, can u correct me where i am going wrong! plz

Parse error: syntax error, unexpected T_RETURN, expecting ',' or ';' in
Ramu, how are we supposed to know where that error is? We aren't psychics.

Post the relevant code and post the full error statement.
Mar 13 '08 #5
Ramu528
18 New Member
Ramu, how are we supposed to know where that error is? We aren't psychics.

Post the relevant code and post the full error statement.
Hi friends,

i able correct my code with help of SAMAS. thanks samas.

its first time, sorry, i will post my code with error from next time.
good day.
Mar 13 '08 #6
Ramu528
18 New Member
Try this:
[PHP]echo "<td width='68' ><a href='index2.php?option=com_qualification&cid=$cid &type=delete' onclick='return confirm(\"Delete item?\");'> Delete</a> </td>";[/PHP]
hi satas, can we write our own validation, i mean writing function like this::

onclick="gotodelete(row(id))";

can u help me out here.

with 'return confirm' i am not able to delete the record. But i am showing alert message and when pressing ok button , the page is just refreshing.

plz satas.
Mar 13 '08 #7
satas
82 New Member
Hi Ramu528.
You should insert URL to some script that will delete the record.
e.g. < a href="delrec.php?rowid=1">delete</a>
In delrec.php you should receive rowid parameter and perform necessary actions.
After that you can return to previous page by using:
[PHP]header("Location: http://blah-blah.com/index.php");[/PHP]
Mar 13 '08 #8
Ramu528
18 New Member
Hi Ramu528.
You should insert URL to some script that will delete the record.
e.g. < a href="delrec.php?rowid=1">delete</a>
In delrec.php you should receive rowid parameter and perform necessary actions.
After that you can return to previous page by using:
[PHP]header("Location: http://blah-blah.com/index.php");[/PHP]

Thanks Satas. I could complete my task with ur cooperation. thanks alot.
All the Best
Mar 13 '08 #9

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

Similar topics

2
by: Ing. Rajesh Kumar | last post by:
Hi everybody Validation controls are great but i have a scenario where i do not know how to use them so i am doing my validation on the server. Let's say I have a Web Form with : Two Textboxes :...
3
by: Paul | last post by:
This is what I am trying to do *********************************form1*********************** Control 1 required field validator 1 Control 2 required field validator 2 Submit button 1 (works...
2
by: Matt Mercer | last post by:
Hi, My first post here. I am a self-taught, very "green" web developer. It is not the main focus of my job but required from time to time. I am developing a web application that logs security...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
45
by: Pat | last post by:
its seems asp.net validation doesn't fire when using FireFox? Tested a page and it doesn't fire. It seems the javascript doesn't fire Any ideas?
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
2
by: winnie_us99 | last post by:
Hi All, I am trying to do validation on my text field before going to the next page to create a user. It doesn't look like the next button will fire any validation. Am I missing something? Can...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
0
by: tanish2k | last post by:
hi. I am using c#, visual studio 2003. I need to validate a xml file against schema which itself has 2 more schema imported under it. i have following 2 xsd files : xsd1 --->...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
1
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.