「5-5」码农商城实现商品数据提交到Mysql数据库

访问不了Youtube?
1.点击搭建自己的ss并开启bbr快速上网教程轻松访问1080p高清Youtube视频。
2.点击本节b站视频教程地址观看。

我们之前已经通过逆向工程获取到了 Product 这个实体类,那么我们在提交表单数据的时候,我们的标签 name 值需要和属性值对应起来。

1
2
3
4
5
6
7
8
9
private Integer id;
private Short categoryId;
private String name;
private String image;
private Long maketPrice;
private Long price;
private Byte status;
private String description;
private String productNumber;

对于一些需要通过 js 获取的值,我们可以使用 hidden 属性的 input 标签来接收数据:

1
2
3
<input type="hidden" name="categoryId"  />
<input type="hidden" name="image" />
<input type="hidden" name="description" />

对于分类 id 的获取:

1
2
3
4
5
6
7
8
9
10
11
12
$("#addProductForm").find("select[name='cid2']").combobox({
onChange: function() {
var value=$("#cc2").val();

if(value == 0){
$(大专栏
上一篇:php-嵌入特色图片(大缩略图)


下一篇:javascript-尝试使用VideoJS,VideoJS-YouTube,VideoJS-Playlist和VideoJS-Playlist-UI