Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Problem after validation

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Problem after validation

Postby HussainMHB » Sat Apr 27, 2013 9:58 am

I'm very new to this side. I joined a company as php trainee week ago. They've given me task. Its going okay. Now I'm getting problem is.
Employ Id: <input type="text" name="empid">
<input type="button" name="getemp" onClick="empvalidate();" value="get Employ">
<input type="button" name="process" value="process">

here i need some help that i validated the employ id like whether textbox is empty or not / valid id or not...(validation Javascript)
after click the validate button, if there is valid id given, then i immediately need one message in alert box that contains respective employ name which needs to be taken from database. This message is just for confirmation.
If ok, then click the process and process needs to take place.

Important thing is that I've only one page for this named empatt.php in this php file, there is one form having 2 buttons and 1 text and also coding for the process. Please let me know clearly how can i do this fully as i am beginner. Please tolerate English wording mistakes.
I'll be so grateful.
HussainMHB
New php-forum User
New php-forum User
 
Posts: 10
Joined: Sat Apr 13, 2013 2:53 am

Re: Problem after validation

Postby johnj » Sun Apr 28, 2013 1:48 am

You already have, onclick="empvalidate()". So, go ahead and write this validation function using JavaScript. Please read about how to write a JavaScript function.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Problem after validation

Postby swarups » Sun Apr 28, 2013 9:42 pm

Hi,

Here you need to do AJAX. After verification of EMP id, you need to find the EMP name as per the id. So I guess AJAX is required.


Thanks
Swarup
swarups
New php-forum User
New php-forum User
 
Posts: 20
Joined: Tue Mar 06, 2012 11:05 pm

Re: Problem after validation

Postby HussainMHB » Mon Apr 29, 2013 4:48 am

Thanks buddy.
But haplessly i don't know AJAX.
Is there any alternative solution to figure out this problem.
HussainMHB
New php-forum User
New php-forum User
 
Posts: 10
Joined: Sat Apr 13, 2013 2:53 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.