FormInfo *form = form_link->form; int c = DO_NOTHING; int OrigNumValue;   if (form == NULL) { return(c); }   move(form_link->ly, form_link->lx);  switch(form->type) { case F_CHECKBOX_TYPE: if (form->disabled == YES) break; if (form->num_value) { form_link->hightext = unchecked_box; form->num_value = 0; } else { form_link->hightext = checked_box; form->num_value = 1; } break;  case F_OPTION_LIST_TYPE: if (!form->select_list) { HTAlert(BAD_HTML_NO_POPUP); c = DO_NOTHING; break; }  if (form->disabled == YES) { int dummy; dummy = popup_options(form->num_value, form->select_list, form_link->ly, form_link->lx, form->size, form->size_l, form->disabled); #if defined(FANCY_CURSES) || defined(USE_SLANG) if (!enable_scrollback) #if defined(VMS) && !defined(USE_SLANG) c = DO_NOTHING; #else c = 23;   #endif  else #endif  c = 12;   break; } OrigNumValue = form->num_value; form->num_value = popup_options(form->num_value, form->select_list, form_link->ly, form_link->lx, form->size, form->size_l, form->disabled);  { OptionType * opt_ptr = form->select_list; int i; for (i = 0; i < form->num_value; i++, opt_ptr = opt_ptr->next) ;   form->value = opt_ptr->name;  form->cp_submit_value = opt_ptr->cp_submit_value;  form->value_cs = opt_ptr->value_cs; } #if defined(FANCY_CURSES) || defined(USE_SLANG) if (!enable_scrollback) #if defined(VMS) && !defined(USE_SLANG) if (form->num_value == OrigNumValue) c = DO_NOTHING; else #endif  c = 23;	  else #endif  c = 12;   break;  case F_RADIO_TYPE: if (form->disabled == YES) break;  if (form->num_value) { HTUserMsg(NEED_CHECKED_RADIO_BUTTON); } else { int i;  lynx_start_radio_color (); for (i = 0; i < nlinks; i++) { if (links[i].type == WWW_FORM_LINK_TYPE && links[i].form->type == F_RADIO_TYPE && links[i].form->number == form->number &&  !strcmp(links[i].form->name, form->name) && links[i].form->num_value) { move(links[i].ly, links[i].lx); addstr(unchecked_radio); links[i].hightext = unchecked_radio; } } lynx_stop_radio_color ();  HText_activateRadioButton(form);  form_link->hightext = checked_radio; } break;  case F_TEXT_TYPE: case F_TEXTAREA_TYPE: case F_PASSWORD_TYPE: c = form_getstr(form_link); if (form->type == F_PASSWORD_TYPE) form_link->hightext = STARS(strlen(form->value)); else form_link->hightext = form->value; break;  case F_RESET_TYPE: if (form->disabled == YES) break; HText_ResetForm(form); *refresh_screen = TRUE; break;  case F_TEXT_SUBMIT_TYPE: c = form_getstr(form_link); if (form->disabled == YES && (c == '\r' || c == '\n')) { c = '\t'; break; } if (c == '\r' || c == '\n') { form_link->hightext = form->value; if (!form->submit_action || *form->submit_action == '\0') { HTUserMsg(NO_FORM_ACTION); c = DO_NOTHING; break; } else if (form->submit_method == URL_MAIL_METHOD && no_mail) { HTAlert(FORM_MAILTO_DISALLOWED); c = DO_NOTHING; break; } else { if (form->no_cache && form->submit_method != URL_MAIL_METHOD) { LYforce_no_cache = TRUE; reloading = TRUE; } HText_SubmitForm(form, newdoc, link_name, form->value); } if (form->submit_method == URL_MAIL_METHOD) { *refresh_screen = TRUE; } else {  newdoc->link = 0; newdoc->internal_link = FALSE; } c = DO_NOTHING; break; } else { form_link->hightext = form->value; } break;  case F_SUBMIT_TYPE: case F_IMAGE_SUBMIT_TYPE: if (form->disabled == YES) break; if (form->no_cache && form->submit_method != URL_MAIL_METHOD) { LYforce_no_cache = TRUE; reloading = TRUE; } HText_SubmitForm(form, newdoc, link_name, link_value); if (form->submit_method == URL_MAIL_METHOD) *refresh_screen = TRUE; else {  newdoc->link = 0; newdoc->internal_link = FALSE; } break;  }  return(c);
return change_form_link_ex(form_link,newdoc,refresh_screen,link_name, link_value,use_last_tfpos,immediate_submit, FALSE  );
PUBLIC int change_form_link ARGS5(	struct link *,	form_link,	document *,	newdoc,	BOOLEAN *,	refresh_screen,	char *,		link_name,	char *,		link_value){    FormInfo *form = form_link->form;    int c = DO_NOTHING;    int OrigNumValue;	/*	 *  If there is no form to perform action on, don't do anything.	 */	if (form == NULL) {	    return(c);	}    /*     *  Move to the link position.     */    move(form_link->ly, form_link->lx);    switch(form->type) {	case F_CHECKBOX_TYPE:	    if (form->disabled == YES)		break;	    if (form->num_value) {		form_link->hightext = unchecked_box;		form->num_value = 0;	    } else {		form_link->hightext = checked_box;		form->num_value = 1;	    }	    break;	case F_OPTION_LIST_TYPE:	    if (!form->select_list) {		HTAlert(BAD_HTML_NO_POPUP);		c = DO_NOTHING;		break;	    }	    if (form->disabled == YES) {		int dummy;		dummy = popup_options(form->num_value, form->select_list,				form_link->ly, form_link->lx, form->size,				form->size_l, form->disabled);#if defined(FANCY_CURSES) || defined(USE_SLANG)		if (!enable_scrollback)#if defined(VMS) && !defined(USE_SLANG)		    c = DO_NOTHING;#else		    c = 23;  /* CTRL-W refresh without clearok */#endif /* VMS && !USE_SLANG */		else#endif /* FANCY_CURSES || USE_SLANG */		    c = 12;  /* CTRL-L for repaint */		break;	    }	    OrigNumValue = form->num_value;	    form->num_value = popup_options(form->num_value, form->select_list,				form_link->ly, form_link->lx, form->size,				form->size_l, form->disabled);	    {		OptionType * opt_ptr = form->select_list;		int i;		for (i = 0; i < form->num_value; i++, opt_ptr = opt_ptr->next)		    ; /* null body */		/*		 *  Set the name.		 */		form->value = opt_ptr->name;		/*		 *  Set the value.		 */		form->cp_submit_value = opt_ptr->cp_submit_value;		 /*		  *  Set charset in which we have the submit value. - kw		  */		form->value_cs = opt_ptr->value_cs;	    }#if defined(FANCY_CURSES) || defined(USE_SLANG)	    if (!enable_scrollback)#if defined(VMS) && !defined(USE_SLANG)		if (form->num_value == OrigNumValue)		    c = DO_NOTHING;		else#endif /* VMS && !USE_SLANG*/		c = 23;	 /* CTRL-W refresh without clearok */	    else#endif /* FANCY_CURSES || USE_SLANG */                c = 12;  /* CTRL-L for repaint */            break;	case F_RADIO_TYPE:	    if (form->disabled == YES)		break;		/*		 *  Radio buttons must have one and		 *  only one down at a time!		 */	    if (form->num_value) {		HTUserMsg(NEED_CHECKED_RADIO_BUTTON);	    } else {		int i;		/*		 *  Run though list of the links on the screen and		 *  unselect any that are selected. :)		 */		lynx_start_radio_color ();		for (i = 0; i < nlinks; i++) {		    if (links[i].type == WWW_FORM_LINK_TYPE &&			links[i].form->type == F_RADIO_TYPE &&			links[i].form->number == form->number &&			/*			 *  If it has the same name and its on...			 */			!strcmp(links[i].form->name, form->name) &&			links[i].form->num_value) {			move(links[i].ly, links[i].lx);			addstr(unchecked_radio);			links[i].hightext = unchecked_radio;		    }		}		lynx_stop_radio_color ();		/*		 *  Will unselect other button and select this one.		 */		HText_activateRadioButton(form);		/*		 *  Now highlight this one.		 */		form_link->hightext = checked_radio;	    }	    break;	case F_TEXT_TYPE:	case F_TEXTAREA_TYPE:	case F_PASSWORD_TYPE:	    c = form_getstr(form_link);	    if (form->type == F_PASSWORD_TYPE)		form_link->hightext = STARS(strlen(form->value));	    else		form_link->hightext = form->value;	    break;	case F_RESET_TYPE:	    if (form->disabled == YES)		break;	    HText_ResetForm(form);	    *refresh_screen = TRUE;	    break;	case F_TEXT_SUBMIT_TYPE:	    c = form_getstr(form_link);	    if (form->disabled == YES &&		(c == '\r' || c == '\n')) {		c = '\t';		break;	    }	    if (c == '\r' || c == '\n') {		form_link->hightext = form->value;		if (!form->submit_action || *form->submit_action == '\0') {		    HTUserMsg(NO_FORM_ACTION);		    c = DO_NOTHING;		    break;		} else if (form->submit_method == URL_MAIL_METHOD && no_mail) {		    HTAlert(FORM_MAILTO_DISALLOWED);		    c = DO_NOTHING;		    break;		} else {		    if (form->no_cache &&			form->submit_method != URL_MAIL_METHOD) {			LYforce_no_cache = TRUE;			reloading = TRUE;		    }		    HText_SubmitForm(form, newdoc, link_name, form->value);		}		if (form->submit_method == URL_MAIL_METHOD) {		    *refresh_screen = TRUE;		} else {		    /*		     *  Returns new document URL.		     */		    newdoc->link = 0;		    newdoc->internal_link = FALSE;		}		c = DO_NOTHING;		break;	    } else {		form_link->hightext = form->value;	    }	    break;	case F_SUBMIT_TYPE:	case F_IMAGE_SUBMIT_TYPE:	    if (form->disabled == YES)		break;	    if (form->no_cache &&		form->submit_method != URL_MAIL_METHOD) {		LYforce_no_cache = TRUE;		reloading = TRUE;	    }	    HText_SubmitForm(form, newdoc, link_name, link_value);	    if (form->submit_method == URL_MAIL_METHOD)		*refresh_screen = TRUE;	    else {		/* returns new document URL */		newdoc->link = 0;		newdoc->internal_link = FALSE;	    }	    break;    }    return(c);}