| |

VerySource

 Forgot password?
 Register
Search
View: 862|Reply: 5

About data validation anxious! anxious!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-9 17:20:01
| Show all posts |Read mode
table: id, chin_name, eng_name (N data in the table)
problem:
Enter the id through the web form (type = text). If there is no such id in the database table, the pop-up prompt will be similar: alert ("this" + id + "does not exist, please enter it again!");
If the database table has this id, there is no prompt, you can post.
How do I write this code? ? ? ?
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-29 23:45:01
| Show all posts
No one answered, depressed
Reply

Use magic Report

2

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Asia/Pacific Region

Post time: 2020-1-30 23:18:01
| Show all posts
AJAX can do it.
Reply

Use magic Report

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-31 12:45:01
| Show all posts
Yep. . I am also a novice, but feel that you use sql to select the id and put it into an array, then use mysql_fetch_row, and then return the id in this array [index] according to the format of your database. If you have any, just post it. I do n’t know if you can use it. .
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-3 17:00:01
| Show all posts
.... If you do not use AJAX technology, you will not be able to access the server's database without POSTing data.

Because only after you submit the data, the server will respond to your request.

Of course, you can also save all the field IDs in the database when reading this page in advance, write the XML data format with PHP, and then use JAVASCRIPT to judge locally.

AJAX technology also works, this technology can directly access the server without POST. But I didn't do much research on this. Ha ha.
Reply

Use magic Report

0

Threads

20

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-2-6 17:15:01
| Show all posts
Everyone said that they can post data, which is also about traditional form submission.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list