• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Prefill book name

Prefill book name 14 years 11 months ago #7667

Hi,
I need to build a Book Order Form. I want that the name of the book get pre-filled in the form depending upon from where( which Page ) the user has ordered it. Every Book has it's own page and the URLs are like

xxxx.com/Books-for-sale/oracle-e-business.html

Last part of the URL is nothing but the book name.

How can I achieve this? I have seem similar queries in the Forum but can not get much out of the solutions provided, so please be more specific.

Thanks in advance.

Sudhir
The administrator has disabled public write access.

Re:Prefill book name 14 years 11 months ago #7679

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can make a custom script that verifies if the current URL is equal with a certain string (any book name you want). You can use parse_url to parse the URL into a string. After that you can check in the default values of the fields the value of the string (that is equal with value of URL) and then the field that is associated with the URL will take the value that you want.

Regards!
The administrator has disabled public write access.

Re:Prefill book name 14 years 11 months ago #7688

Can you please give me example of the script I need to put ? Also how and where I need to use pars_url ?
I am not very good with scripting so please explain in detail.

Thanks
The administrator has disabled public write access.

Re:Prefill book name 14 years 11 months ago #7700

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

All the scripts should be put in the Default Value of the field you want to populate. You will need a function that takes the URL. After you have the URL you will to parse it(to find out the name of the book, here you can use parse_URL). After that you will have to put the name of the book in the field, so as I said all the script will go in the Default Value box.

You can refer to www.php.net for functions and tutorials on how to script.

Regards!
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!