PDA

View Full Version : How to add new input field to content table?


jilong
03-05-2007, 06:14 AM
I would like to have one more field which allow member to key in URL.

what i did is using
1. phpMyAdmin add a new column call "URL" in `jos_content` table
2. Add the input field in "ja_submit.html.php"

<tr>

<td><label for="price"><?php echo _H_URL; ?>*</label>:</td>

<td><input class="inputbox" type="text" name="url" id="submit_url" size="50" maxlength="50" /></td>

</tr>

now my problem is i don't know how to write the value into database. Does you guy have any ideal how to do this?

jselkcin
05-02-2007, 10:48 AM
Hi guys, I'm also trying to add a field or two. I tried these same steps, but I can't figure out how to get the new input fields to get stored in the mysql database.

If anyone knows how to activate new input fields and get them working smoothly, please share!!!

thank you.

mikaelfs
05-02-2007, 05:44 PM
these are the steps (in case you're adding a new field to jos_content)
1. create the field by invoking "alter table" command
2. add html input to components/com_ja_submit/ja_submit.html.php
3. modify function submit_save_form() in components/com_ja_submit/ja_submit.php to also insert url data provided by user

jselkcin
05-03-2007, 01:44 AM
these are the steps (in case you're adding a new field to jos_content)
1. create the field by invoking "alter table" command
2. add html input to components/com_ja_submit/ja_submit.html.php
3. modify function submit_save_form() in components/com_ja_submit/ja_submit.php to also insert url data provided by user

Thanks for responding.

1) Can I do this "alter table" command through phpMyadmin?
2) Should this code be that code which "jilong" posted above?
3) If its not too much trouble, could you provide the code which needs to be modified?

Thank you.

mikaelfs
05-03-2007, 03:59 PM
hi

1) yes
2) yes, it's a part of the solution but it's still incomplete
3) well, there is no such generic form field/input generator in ja_submit. if you want to add new field, you need to hardcode current files by adding necessary input in the template file and later modify the processing file. since this is case specific, i can't supply readily deployed codes.

jselkcin
05-05-2007, 10:11 PM
hi

1) yes
2) yes, it's a part of the solution but it's still incomplete
3) well, there is no such generic form field/input generator in ja_submit. if you want to add new field, you need to hardcode current files by adding necessary input in the template file and later modify the processing file. since this is case specific, i can't supply readily deployed codes.

1) okay great, I figured that part out via mysql
2) would you mind posting the code that needs to be added to ja_submit.html.php cuz I'm sure many users here would benefit from it, including myself
3) could you specify where to hardcode in new code in the template file and processing file, perhaps using an example field?

thank you.

kenada
02-02-2008, 03:14 AM
1) okay great, I figured that part out via mysql
2) would you mind posting the code that needs to be added to ja_submit.html.php cuz I'm sure many users here would benefit from it, including myself
3) could you specify where to hardcode in new code in the template file and processing file, perhaps using an example field?

thank you.

so what is the code I inject into the ja_submit.php ?? I have done all the other stuff.... help please?

instead of using url mine is woc, meaning word count. help please