It is currently Sun Nov 19, 2017 10:08 am




Post new topic Reply to topic  [ 2 posts ] 
How to refer to a field in an add form in PHP or JS 
Author Message

Joined: Wed Jun 04, 2008 4:42 pm
Posts: 10
Post How to refer to a field in an add form in PHP or JS
In an edit form I can say:

$cellvalue=$row[rs_idx_somefield];

How do I do the same thing on an add form?

_________________
If you are going through hell, keep going.
Winston Churchill


Wed Jun 04, 2008 9:04 pm
Profile E-mail
Site Admin

Joined: Wed Sep 05, 2007 6:29 pm
Posts: 361
Location: Bangkok
Post Re: How to refer to a field in an add form in PHP or JS
On an add, you are inserting a new record. So there are no $row values read from the database. The record does not exist until after the add.
If you are looking to default a value in and add form you can do that in JavaScript or in the On write tag of the input field adding a value attribute. CellValue = "<input type=""text"" name=""add_fd6"" value="""3333""">"
for mor info on using JS to default values here is an example:
Custom Code for "Add Products -> On Load" [...] Custom Code for "Add Products -> On Load"
//make Product name the focused field
pgitm_Product_Name.focus();
//Set Filed Default values
pgitm_Quantity_Per_Unit.value = 1;
pgitm_Product_Name.value = "enter product name";
pgitm_Unit_Price.value = "xx.00";
pgitm_Reorder_Level.value = 25;

_________________
Gerald Enright
CEO TheDevShop Ltd.


Wed Jun 04, 2008 9:55 pm
Profile WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Copyright © 2004-2008 TheDevShop Ltd. All Rights Reserved