PHP/MySQL: 'Add New' text field from menu in form
I am creating an events posting website. I'm having a hard time finding the right words to describe this, but: I'd like the user to select a venue from the drop menu, but then if it isn't there, to select 'add new' from the dynamic menu, and have a new text field activate where they can enter in the new venue name. My database is currently set up so the event table links to the venue table through a venueID. Is there a way to insert the name from the new text field into the venue table, and have the rest of the form still submit to the event table? Sorry this is so wordy, but I'd appreciate any help. Thank you.
You cannot add a new value to a related table at the same time as inserting a record. So, to do this, you would need to use both JavaScript to add the new text field, and PHP conditional logic to handle the update to both tables. It's certainly doable, but not with the Dreamweaver server behaviors. You would need to do a lot of hand-coding yourself.
The way that I approached a similar problem in my "Essential Guide to Dreamweaver CS4" was to permit NULL values in the column that holds the foreign key, and insert nothing into that field if the value hadn't already been registered in the related table. I created a static value in the dynamic menu for "Not registered".
After inserting the new record with "not registered", the user then needs to enter the new value in the related table.
Once that has been done, display a page that lists all records. In the SQL, I use a LEFT JOIN to ensure that "not registered" items come up as well. You can then edit the item to add the value from the dynamic menu.
It's not the most elegant way to do it, but it works if you don't have the skill or time to hand-code all the logic yourself.
Similar Messages
-
How to add new text field in standard report
how to add new text field in standard report?
Hi,
I presume you are talking about a report display in ALV and u wish to add a column to it .
If it is a global requirement ,as in table being used there in ALV can be modified, then you can append the table and the system should pick up the same automatically from there.
Otherwise , you can make a Z program . Modify the catalog being used in ALV.
Regards,
Shweta -
How to add new "text" field in GL item fast entry?
Hi Gurus,
Is that possible to add "text" column or field in GL item fast entry. For example, if i go to Txn F-04, i enter all the details then i go to: "Goto>GL item fast entry (shift+F8). Now you will see layout (GL item fast entry). So back to my question before, is that possible to add new field or column (text field) in this layout? If the answer is Yes, appreciate Gurus help and guide me in configuration, if any.
Thank you
Regards,
NazrulHi Sreehari Annavaram,
Thank you for your kind reply. Based on the answer from the link you have given me (as per below quote), there's no "DEM03" in my selection screen. We only have SAP01, SAP02 and GL001 (customised layout). That's why i had created new customised layout GL002 and try to add the "text" field in layout as per my first question. But system still won't allow it.
*"In F-02 under editing option screen screen templates and line layout variant for document entry will be there in that
GL accounts items for fast entry select DEM03 u will get the text item"*
Appreciate help.
Thank you
Regards,
Nazrul -
Need to add new Text Field on the Screen
Hi,
I am using Oracle 9 Designer and generating the web pages using web pl/sql language. After I generate the page, my screen looks like this:
Employee id: TextField
Employee Name: TextField
I want to add a comment"(Please enter characters Only" below the Employee ID like the following:
Employee id : TextField
(Please enter characters Only)
Employee Name: TextField
Can anybody help me how to add this in the designer form?
thanks in advance.You can do this with an unbound item on a View Form. You cannot do it at all for an Insert Form. There is a work around but takes a little explaining for the Insert Form. You need to create a web page from the insert form html, modify it manually. I do it as a simple procedure so it is consistent with the rest of the application. Then all menus, links, etc. need to reference that page instead of the FormInsert procedure in the generated package.
There may be other work arounds. Without knowing more about your requirements, I can't say.
John Caputo
[email protected] -
Javascript to fill text field from other PDF form
I am trying to figure out if it is possible to add javascript to a text field that when initiated pulls text from another field in a closed pdf in the same directory.
For example I have a NAME field in the pdf form I am working in....
When I initiate the script the NAME field is filled in with the same data from another PDF that is closed.I have looked up the 'disclosed' property and it looks like that is what I want to do..
I have "this.disclosed = true" in a PDF with the name field. On the other PDF that I want the information replicated I am going to add a javascript to an action somewhere on the document, my problem is which script do I use to get this data from the other pdf? Is the pdf that is now accessible via javascript (disclosed) a data object? -
Add new text field in Address Book?
I can export my address book using the Address Book Exporter Utility.
However, instead of creating a label with First Last (e.g., Bob Dylan) as stored in Address Book, I would like to use a custom field, Mr. First Last & Family (Bob and Joan Dylan). I know I can make those edits in Excel after the export and send off to my mailing house, but then it isn't saved in Address book.
If I create a custom field (say "Envelope Label") under Related Names, it doesn't export with that utility. Any ideas?Hai Ramesh ,
Could u please ellobrate the requirement , you need new field to be added in the screen level .
Regards,
K.Vinay Kumar -
[php+mysql] how to pass data from one insert form to another?
Hi all,
I have an insert form (in a mysql db) on the page. Is there a way to
view the inserted data after inserting so stat the user can print it
out?
TIA
tony>Hi Tony,
>let´s assume the table´s Primary Key column is named "id" -- just add this value (available as "Dynamic Data") to the "Redirect after Insert" URL in the following way:
>print.php?id={id}
>...and on that page add a recordset which queries the table like that:
>"SELECT * FROM tablename WHERE id" equals the URL parameter "id"
>That should be all there is to do.
>Cheers,
>Günter Schenk
>Adobe Community Expert, Dreamweaver
Hi Günter,
Thanks, it works.
I added a bit of code to set a session variable using this Parameter
URL, so that I can manage the record ID along the whole user session.
So, I ask you a little question: when it is best to delete or destroy
session variables? after displaying the inserted records or just befor
inserting the first one?
Here is my little test workflow:
1- destroy variable sessions (I think I will unset session variables
one by one instead, to eliminate the risk to delete other sesssion
variable (UserID...)
2- insert the first record (redirect to the next page using the record
ID1)
3- set a session variable (S1) using the ID1 coming from previous page
($_GET)
4- insert the second record (redirect to the next page using the
record ID2)
5- set a session variable (S2) using the ID2 coming from previous
page ($_GET)
6- insert the third record (redirect to the next page using the
record ID3)
7- set a session variable (S3) using the ID3 coming from previous page
($_GET)
8- create a recordsets to filter the db by S1, S2 and S3.
9- display the report
it seems to work.
do you think there is something to refine?
Thanks again for your kindness.
tony -
Remove text field from Array via for loop
Hi,
i have a problem to remove text fields added via for loop.
That im doing is, via for loop im dynamically creating menu with 10 buttons.
Each button contain, dynamically created, background (shape) and text field.
And everything is fine.
But when im try to remove text fields then i got this error:
- Im using button to remove text fields - lang_btn.addEventListener(MouseEvent.CLICK, clickHandler);
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at Loading_Img_fla::MainTimeline/xmlLoaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
In the script bellow marked with red is what should remove text fields from an Array, instead giving me error.
Here is my script
// Create for loop
for (var i:int = 0; i < 10; i++)
for each (xml in listItems)
if (i == xml.attribute("Id"))
// Add MovieClip to stage to hold the data
addChild(lmHolder);
lmHolder.x = 0;
lmHolder.y = 0;
// Create new MovieClip to hold buttons
lmButtonsMCArray[i] = new MovieClip();
lmButtonsMCArray[i].buttonMode = true;
lmButtonsMCArray[i].mouseChildren = false;
lmButtonsMCArray[i].x = 20;
lmButtonsMCArray[i].y = 20 + btCount * buttonSpace;
// Add each button MovieClip to lmHolder MovieClip
lmHolder.addChild(lmButtonsMCArray[i]);
// Create Background to buttons
lmButtonsArray[i] = new Shape();
lmButtonsArray[i].graphics.beginFill(lmBgColor0, 1);
lmButtonsArray[i].graphics.drawRect(0, 0, 230, 85);
lmButtonsArray[i].x = 0;
lmButtonsArray[i].y = 0;
// <<-- Add Background shape to the buttons MovieClips
lmButtonsMCArray[i].addChild(lmButtonsArray[i]);
// Create a new array to preserve data from XML List
lmNameArrayEG = new Array();
lmNameArrayUS = new Array();
// Create local variable to hold
var lmTxtFieldContentUS:String;
var lmTxtFieldContentEG:String;
var lmTxtContent:String;
// If clicked button is EG then make array with Arabic text
// If clicked button is US then make array with English text
if (footer.lang_btn.langState == "EG")
for each (var leftMenuName:XML in egLanguageList)
lmNameArrayEG.push(leftMenuName);
lmTxtFieldContentEG = lmNameArrayEG[i];
lmTxtContent = lmTxtFieldContentEG;
else
for each (var leftMenuNameUS:XML in usLanguageList)
lmNameArrayUS.push(leftMenuNameUS);
lmTxtFieldContentUS = lmNameArrayUS[i];
lmTxtContent = lmTxtFieldContentUS;
// Setup new text field each time script is executed
lmTxtFieldsArray[i] = new TextField();
lmTxtFieldsArray[i].width = 110;
lmTxtFieldsArray[i].border = false;
lmTxtFieldsArray[i].wordWrap = true;
lmTxtFieldsArray[i].multiline = true;
lmTxtFieldsArray[i].selectable = false;
lmTxtFieldsArray[i].embedFonts = true;
lmTxtFieldsArray[i].antiAliasType = AntiAliasType.ADVANCED;
lmTxtFieldsArray[i].autoSize = TextFieldAutoSize.CENTER;
lmTxtFieldsArray[i].text = lmTxtContent.toUpperCase();
lmTxtFieldsArray[i].x = 10;
lmTxtFieldsArray[i].name = "lmTxtFieldName" + i;
// <<-- Add Text fields to the Movie Clip
lmButtonsMCArray[i].addChild(lmTxtFieldsArray[i]);
// If clicked button is EG then set Arabic text format, and make array with Arabic text fields
// If clicked button is US then set English text format, and make array with Egnlish text fields
if (footer.lang_btn.langState == "EG")
lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_eg);
// Make array from text fields;
pushEgTFintoArray.push(lmTxtFieldsArray[i]);
else
lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_us);
// Make array from text fields;
pushUsTFintoArray.push(lmTxtFieldsArray[i]);
// If clicked button is EG then loop thrue the for loop and remove English text fields from array
// If clicked button is EG then loop thrue the for loop and remove Arabic text fields from array
if (footer.lang_btn.langState == "EG")
for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
//remove the text field array from the display
removeChild(pushUsTFintoArray[rNr_us]);
//clear the array
pushUsTFintoArray = [];
else
for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
//remove the text field array from the display
removeChild(pushEgTFintoArray[rNr_eg]);
//clear the array
pushEgTFintoArray = [];
btCount++;it looks like those tf's are children of lmButtonsMCArray[i], not the current scope. use:
if (footer.lang_btn.langState == "EG")
for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
//remove the text field array from the display
lmButtonsMCArray[rNr_us].removeChild(pushUsTFintoArray[rNr_us]);
//clear the array
pushUsTFintoArray = [];
else
for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
//remove the text field array from the display
lmButtonsMCArray[rNr_eg].removeChild(pushEgTFintoArray[rNr_eg]);
//clear the array
pushEgTFintoArray = []; -
How can I get the "text" field from the actionEvent.getSource() ?
I have some sample code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.ArrayList;
public class JFrameTester{
public static void main( String[] args ) {
JFrame f = new JFrame("JFrame");
f.setSize( 500, 500 );
ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
buttonsArr.add( new JButton( "first" ) );
buttonsArr.add( new JButton( "second" ) );
buttonsArr.add( new JButton( "third" ) );
MyListener myListener = new MyListener();
( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
JPanel panel = new JPanel();
panel.add( buttonsArr.get( 0 ) );
panel.add( buttonsArr.get( 1 ) );
panel.add( buttonsArr.get( 2 ) );
f.getContentPane().add( BorderLayout.CENTER, panel );
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
f.setVisible( true );
public static class MyListener implements ActionListener{
public MyListener() {}
public void actionPerformed( ActionEvent e ) {
System.out.println( "hi!! " + e.getSource() );
// I need to know a title of the button (which was clicked)...
}The output of the code is something like this:
hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
I need this: "first" (from this part: "text=first" of the output above).
Does anyone know how can I get the "text" field from the e.getSource() ?System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
In a real-world application, no.
In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button). -
Adding a new text field in Shopping Cart screen
Hi,
I am new to SRM and I am working on SRM 5.0
My requirement is to add a text field for buyer's note with unlimited length similar to Approver's note in Shopping Cart screen.
I have seen in the forum that many have done this earlier and i need step by step procedure to complete this task.
I am able to create text field in Text Schema, but this field is not reflecting in shopping cart screen. Do i need to do any thing extra apart from maintaining in Text schema?
Can you please send the detailed procedure to do this task?
Thanks in advance.
Regards,
VamseeHi Saritha,
Thank you for your help. In fact, i have gone through this link and followed the steps there. But, the Text ID is not reflecting in my shopping cart.
We are using SRM 5.0. The requirement is to add a new text field with unlimited length similar to the existing Approveru2019s note field in Shopping Cart screen at header level.
I have followed the steps mentioned below.
1.Go to SRM IMGSRM Server->Cross-Application Basic Settings->Text Schema
2.Execute Define Text Types and then select the entry BBP_PD Text Object and click on Text Type.
Here, create new entry for ID as ZHTXT and Description and save it.
3.Execute Define Text Schema and then select the existing Text Schema SC ( Shopping Cart) and click on Texts for Schema.
Here, assign the newly created Text ID with details Header/Item etc.
4.I am not executing the last step Define Fixed Values for Texts, as the Text Schema SC is already assigned Transaction Type Transaction Type SHC.
Please suggest do I need to perform any extra steps apart from Text Schema to reflect the Text ID which I created in my Shopping cart screen? Or do we need to code anything on ITS side?
Thanks in advance.
Regards,
Vamsee -
Pulldown selection creates new text field in a form
I have a set of dynamic select menus that are built using Kaosweaver's http://www.kaosweaver.com/extensions/details.php?id=88
Thanks to Kaosweaver, it works fine. However, I was wondering how someone could have an extra text field popup in a form if certain values from a list/menu are selected. In my case it would be from the 2nd half of the dependent drop down but I would assume the logic would be the same even if someone was not using a dynamic select but instead just a regular list/menu.
Is this possible? I am using Dreamweaver CS4. Also if there is an alternate strategy to use in this situation then I would like to hear suggestions. The basic premise is that a couple values in a select list would need an additional text field to be collected for the form.Thanks for replying!
You know the weirdest thing just happened....I opened the PDF again to make sure it's the correct one to upload and have you take a look and as if by magic, I typed into the fields and now it doesn't disappear!!! I didn't restart any App, nor did I reboot my Mac....weird!!!!! Anyhow, I guess there is no longer an issue. I need a few minutes to finish the form and then I'll check to see if the issue comes up again. If it does, I will definitely upload the PDF and have you take a look at it.
Thanks again!! -
How to remove the automatically generated text fields from the InfoSet
I followed the procedure by SAP help.
Automatically generated text fields are marked with a 'T' on the icon in the InfoSet. You can remove the automatically generated text fields from the InfoSet in the initial screen of the InfoSet maintenance under Further Functions -> Delete Text Fields. Cancel the DataSource creation on the next screen and delete the text fields in the InfoSet maintenance transaction.
I know that there is an option "No automatic text recognition" when I create a new InfoSet, however, I couldn't find out how to change an existed InfoSet. I checked menu Goto->Global Properties, but that option is disabled. Is there a way to remove text fields from an existed InfoSet?Hi,
In the initial screen (when you enter transaction code SQ02) type your infoset name and goto menu: Infoset -> More functions -> Delete text fields. this will delete all text fields.
I hope this helps to resolve the issue.
Ram -
To add a Text field in Standard Transaction
Hi..
i want to add a Text field for a email address in BP transaction Address tab and want to update that in to a data base table So can we suggest User Exit and BADI for the Updation if Any or give the the process to over come this issueHi,
You have not mentioned the version you are using (assume its 5.0 or lower). Also, do you want to add a custom field & also programatically update it? If you want to add a custom field , you can use EEW.
But, from what you have written, I have a feeling that you can use some of the (existing) standard fields. What is your exact requirement.
Regards,
L -
How to add new customise field in standard SAP ME28 Report?
Hi Anybody,
How to add new customise field inside Standard SAP Screen report ME28?.
Anybody, Please tell me how to do?.
Thanks,
Regards,
S.Muthu.Hi Subramaniyam,
You can find enhancement in me28 by following steps and then apply your logic in include of this enhancement.
cmod>Give a project name>in enhancement column give the package name ME >f4>in package write ME-->ENTER>It will show you all enhancements available in me28> find which ever suits your requirement>save > click on components> from there you can make changes in include program.to add that particular field. -
New Text Field To Be Added in Audit Management
Hi All,
I need to create new text fields in addition to the existing fields in Audit Management screen for all the audit components in the TEXT TAB in transaction PLMD_AUDIT.
I would like to know is it possible or not and if not possible then what is the alternate way to include more inofrmation.
Will be rewarded...
Regards,
Ram.Hi Ram,
New text field can be added in the texts tab of plmd_audit transaction is achieved by ,
1) The following entries has to be maintained in the view V_TTXIDI Object, Id, Meaning.
Object-select cgpl_text
Id : you need to define(this id you will refer in the initial value of the attribute in the BADI-name of your text field).
Meaning : short description of your BADI.
save your entries & activate it.
2) Implement this BADI "PLM_AUDIT_TEXT_ID"
within the method "GET_TEXT_IDS" we need add our code for adding the new text fields.Within this method the code for standard text fields would be existing.
3) In the attributes tab of the ZCL_DEF_IM_PLM_AUDIT_TEXT_ID -class interface ,you need to pass the initial value,which has been defined in the view "V_TTXIDI".
4) Finally activate your BADI.The newly added text fields would be available in the PLMD_AUDIT tcode.
Hope this solves your requirement.
Regards,
Keerthi
Maybe you are looking for
-
I will be studying for a year in Japan. I want to buy and bring an iPad. Any advice on which one? If I want cellular service which carrier is likely to be most useful in terms of compatibility or do none work? Thank you
-
Xcelsius based on BEx query. Issue when transporting from DEV to PRD
Hi all, I am facing an issue as described below: I created dashboard based on bex query in Query Browser. Everything is working find in DEV. Then I transport the dashboards to PRD, I also use the override settings to point from BOD-BWD to BOP-BWP, my
-
Migrate Dreamweaver CS 4 site to CS6?
I have a Website created with Dreamweaver CS4 on my Mac running OS 10.7.4. since this new OS does not run Power Mac based applications, I need to open the site files using Drewamweaver CS6. How do I do this? Thanks for your help.
-
Office 2013 .pub keep getting a conversion failure.
I have 43 pages of .pub from Office 2013 that keep failing conversion in the single conversion and the combine files option. I purchased this subscription specifically for this task on time sensitive material and I cannot obtain the PDF.
-
SAP automaticly calculats the credit for samples in Financial Acct mod?
Expert - How do i ensure that when the Materials Product Manager enters production data (includes pills packaged as samples) into the Material Management module of SAP, the system automatically calculates the credit for samples in the Financial Accou