PHP's incurable Diseases (iii)

Source: Internet
Author: User
今天,遇见了一个问题,有些小尴尬,因为我好久没有用过PHP了,所以对smarty不是太熟悉,一开始以为这个是前端html的问题。这里,有一个检索功能,输入检索的信息后,一触发检索后会跳转到检索的结果,可是检索条件信息就被规制为初始化的了。

问题也就是如何使其不会归置为默认值,大致的思路有二:1、使用ajax技术,实现不刷新页面获取数据;2、就是刷新页面获取数据喽!很可惜,第一种太高大上,小白不会,(虽然我第二种也不会),相比较,第二种倒是容易学会。于是尝试起来了修改。

This is the front-end HTML template source code ~ ~ ~

Compared to the two conditional boxes, the first one is selected, the second one is typed, and the second is better implemented.

Of course, here you need to add a function in the background to pass the value:

But the second one is much more troublesome and half-done.
Originally wrote a function in the background, used to get the category name, the front end of a call.

But the effect was unexpected ... It was just a surprise to me.

Theoretically, the final effect should be this way.

This is embarrassing, and then after a variety of experiments, after all, it is impossible to achieve the desired effect. The contents of the drop-down menu change, but the tick is the invariant position.

After consulting a group of friends, found a solution to the < option > tag to add a judgment can be ... This is a bit of an accident!

Solve the code as follows (without modifying the background, directly using the $_get to pass the parameters):

Of course, if you do not want to use $_get, it is also possible to write a forward function in the background to pass parameters.

That

In this way, the problem is solved, ah, the problem after the solution, the feeling is not so difficult to imagine it! The key is not to learn. The front end still wants to learn, otherwise the development really is hard to die ... smarty also must be ripe and even proficient is ~ ~ ~

There is a saying that is not bad: learning without thinking is forgotten, thinking and not learning is crazy, as well!

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above introduces the problem of PHP (iii), including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.