Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Drop Down Box Choose A Name and Have only the first name show up

Avatar

Level 2

I am creating a form for health care.

I have a drop down box with names of Physicians... their full names so they can be easily identified. And then subsequent fields that will be populated based off of the choice. However What I need is that after the full name from the drop down list is selected than only the Dr's First name shows up in the box to be distributed through out the file. All the rest of the information is already in using this Java:

switch(this.rawValue){

    case "MD":

        form1.Page1.Physician1LastName.rawValue = " Acccc";

        form1.Page1.Physician1Number.rawValue = "1111111111";

        form1.Page1.Physician1Fax.rawValue = "2222222222";

        form1.Page1.ClientEmail.rawValue = "none@email.com";

        form1.Page1.Physician1Address.rawValue = "xyz suite ";

        form1.Page1.Physician1City.rawValue = "XYY CIth";

        form1.Page1.Physician1State.rawValue = "XZ";

        form1.Page1.Physician1Zip.rawValue = "11111";

        form1.Page1.Physician1NPI.rawValue = "111111111";

        form1.Page1.Physician1License.rawValue = "ABBB111111";

        form1.Page1.Physician1UPIN.rawValue = "A11111";

        form1.Page1.Physician1Specialization.rawValue = "Internist";

        break;

}

And is working beautifully thanks for previous help everyone.

Here is the example from the Drop Down list choices:

     Dr. Aaaaa Abb Accccc

     Dr. Baaaa Bbb Bccccc

I would like to choose :

     Dr. Aaaaa A Aaaaa

and upon chosing it have it show only the first name in that field so it can be processed correctly through out the rest of the fields.

ie:    Aaaaa   (Only nothing else)

I am a horrible at this stuff I just surf around until I find something that works and copy and paste and play until it works

So Please be specific:

Java vs FOrm: Client: Choice   and code ....

Thanks SO much ....

1 Accepted Solution

Avatar

Correct answer by
Level 10

Take a look at the attached. The script assumes the name is a three-part string such as Dr. Frank Burns. You can modify it according to your needs.

// form1.page1.dd::exit - (JavaScript, client)


if (this.rawValue != null) {

  var doc = this.rawValue;

  var i = doc.indexOf(" ");

  doc = doc.substring(i+1,doc.length);

  this.rawValue = doc.substring(0,doc.indexOf(" "));

}

Steve

View solution in original post

0 Replies

Avatar

Correct answer by
Level 10

Take a look at the attached. The script assumes the name is a three-part string such as Dr. Frank Burns. You can modify it according to your needs.

// form1.page1.dd::exit - (JavaScript, client)


if (this.rawValue != null) {

  var doc = this.rawValue;

  var i = doc.indexOf(" ");

  doc = doc.substring(i+1,doc.length);

  this.rawValue = doc.substring(0,doc.indexOf(" "));

}

Steve